﻿<?xml version="1.0" encoding="utf-8"?>
<data>
  <Article ID="1" CreationDate="2011-05-25T12:34:56.7" LastUpdateDate="2013-05-02T16:37:05.6365266+02:00" ReleaseDate="2010-08-25T12:34:56.7" IsVisible="false" ShowComment="false" Code="Basics" Title="Basics of the Application interface" Description="The basic building block of the user interface is the 'Business Entity'. Every piece of application (e.g. User, Currency) acts as the Business Entity, which can be added, changed and also deleted. And as the essence there is powerful searching and listing interface, which supports even the exporting to the MS Excel (XML format)." ArticleCategoryId="2" ArticleGroupId="2">
    <Text>|H2 [NAME:top] The Application basic User interface overview

|P Index
[NUM
[URL:#appName | TEXT:Application Name]
[URL:#logo    | TEXT:Logo]
[URL:#lang    | TEXT:Language and format selectors]
[URL:#quick   | TEXT:Quick Actions]
[URL:#bread   | TEXT:Bread-crumb control]
[URL:#page    | TEXT:Paging on the detail level]
[URL:#menu    | TEXT:Menu]
[URL:#action  | TEXT:Actions ]
[URL:#user    | TEXT:User information]
[URL:#button  | TEXT:Buttons (editing)]
[URL:#view    | TEXT:View selectors (page layout)]
NUM]

[IMG: files/basics/AppOverview.png | WIDTH: 686px; | HEIGHT: 553px; ]

|PR [URL:#top | TEXT: top]
|H3 [NAME:appName] I. Application Name

Application name (displayed in the upper left corner) describes the application. This text is also navigable and the click will redirect user to the Application home page.
Text of the Application name could be adjusted in the [SAMP:Translator] management, by setting the entity with the key [B:[I:ApplicationName ]](this also allows the different naming for different cultures)


|PR [URL:#top | TEXT: top]
|H3 [NAME:logo] II. Logo
Company Logo provides the second quick way how to get to the Home page. Click on the Logo image will navigate the same way as the Application Name.


|PR [URL:#top | TEXT: top]
|H3 [NAME:lang] III. Language and format selectors
Application is by default ready to operate in multi-language mode. Users can select their 'suitable' culture (by clicking the flag in the upper right corner).
(E.g. [IMG:i/en-GB.png| FLOAT:left;] for British formatting and English phrases)
Selected language has impact on Application behavior in two aspects:
[NUM
Localizing the phrases (description of buttons, actions etc.)
Date and Number formats
NUM]

|H5 Localization
The phrases localizing is in this application very simple, and can be maintained, changed and extended even in production environment.
[IMG:files/Basics/Localization.png | WIDTH: 117px; | HEIGHT: 60px; ]
In the Menu (the TreeView on the left) you can select the [SAMP:Localization] sub-items
[LI
Language
Translator
LI]
These two links will navigate user to the usual [SAMP:Business entities] management.

|H6 Language
Languages can be simply added or removed. This has an impact on the offered languages set int upper right corner.
When user selects the Language this way, Date and Number formats are adjusted to the selected culture standards.

Selected Language also decides about the used phrases on the screen. If there is for example localized phrase for the [DEF:New] (e.g. 'Neu' in German) then it is used. In other cases, the default (usually the English) is used.


|H6 Translator


Translator is (again) only the usual [SAMP:Business Entity], providing the simple way for adjusting the User Interface.
The next picture is an example of EDIT screen for the phrase of the 'New' Key-word.
[IMG:files/Basics/Translator.png | WIDTH: 689px; | HEIGHT: 353px; ]
For any combination (Key, Area) used in application could be the final phrase adjusted this way. The list of languages available in this editing screen depends on the 'allowed' languages (described above).



|PR [URL:#top | TEXT: top]
|H3 [NAME:quick] IV. Quick Actions

There are [VAR:Actions] available on every page. These are accessible by selecting the tab 'Actions' in the left column. These are described in the section below [URL:#action  | TEXT:Actions ].

The mostly used [VAR:Actions] have an abbreviated access in so called Quick actions menu:
[IMG:files/Basics/Quick.png | WIDTH: 229px; | HEIGHT: 62px; ]
The actions on the picture are (from the left):
[LI
New
filter
List view
Export to Excel
LI]

As the picture demonstrates, user can also execute these actions using the [VAR:shortcut key]. For instance there is the [DEF: Shift + Alt + E] to call 'export to excel' action.

|PR [URL:#top | TEXT: top]
|H3 [NAME:bread] V. Bread-crumb control
Bread crumb control is the information area. It provides the assembled description about current page.
[IMG:files/Basics/Breadcrumb.png | WIDTH: 408px; | HEIGHT: 37px; ]
For example (as shown on the picture) there are 4 parts describing the current page
[NUM
Application name - click on this hyperlink will navigate user to the home page
Business Entity (ore business area) - click on this will navigate to the default page of current Business area
Action name - currently executed action e.g. New, Edit, List ...
[I:Optional] is the Entity description (only on detail, or edit screens)
NUM]


|PR [URL:#top | TEXT: top]
|H3 [NAME:page] VI. Paging on the detail level
The [SAMP:Business Entities] are in this application basically managed in so called CRUD steps:
[LI
C - Create (New action)
R - Read (filter and List)
U - Update (Edit button)
D - Delete
LI]

During the R step, user can use searching which results in the List view. The detail view can be easily accessed from the list view by clicking the found rows. To provide more smooth way to iterate the details
and skipping these steps:
[LI
[I:go to one detail]
[I:back to list]
[I:go to another detail]
LI]

[IMG:files/Basics/Paging.png | WIDTH: 172px; | HEIGHT: 62px; ]
There are Paging (moving) buttons on the detail level. User therefore can directly navigate to the next or previous Entity. Of course, these actions are again accessible via [VAR:shortcut key]


|PR [URL:#top | TEXT: top]
|H3 [NAME:menu] VII. Menu (main TreeView navigation)
The central navigation point is situated in the left column - TreeView Menu:
[IMG:files/Basics/Menu.png | WIDTH: 186px; | HEIGHT: 332px; ]
Items of this tree are either (not navigable) Cluster Nodes (e.g. Business) which gathers similar [VAR:Items] or the links to the Default pages of every available [SAMP:Business Area] (Entity).

The offered menu items depend on the User access rights. For instance, if the user has the [DFN:Administrator] role, there is the Administration Cluster node. Without such right, the Menu does not display this item at all.

At any place of the application user can RIGHT click on the link (even in the TreeView menu) and select 'Open in the new Window or Tab'. This will enable to operate with different parts of the application in different windows. There is no limitation about this feature.
[I:Users are also allowed to click the [VAR:BACK] button of the browser to return to previously edited screen. This approach will have no impact to previously stored changes; it only allowes to go back and start new navigation from some of the previously seen page].


|PR [URL:#top | TEXT: top]
|H3 [NAME:action] VIII. Actions
Every [SAMP:Business Area] has the default view. For Entities it is usually the list view (unless the users during the development decided to change this behavior).
From that point user can interact whit the application using the proposed actions:
[IMG:files/Basics/Actions.png | WIDTH: 188px; | HEIGHT: 208px; ]
These are available (all of them) in the Left navigation column below the [VAR:Actions Tab].
The frequently used actions are also available in the [URL:#quick   | TEXT:Quick action icon list].


|PR [URL:#top | TEXT: top]
|H3 [NAME:user] IX. User information
User name and login (used for authorization) are displayed in the User information area:
[IMG:files/Basics/User.png | WIDTH: 192px; | HEIGHT: 95px; ]
Also the currently applied [URL:#lang    | TEXT:Language and Culture] (date and number formatting) are displayed. If application is using the [DFN:Current role approach] - User Information area also contains the link to the [VAR:Role selector] (Just test it).
The [DFN:Current role approach] has one essential advantage for users: They can act with application in different roles e.g.
[LI
[SAMP:Administrator]
[SAMP:Standard User]
LI]
Whenever there is need to execute [I:potentially dangerous] actions (change user rights, remove user) which could lead to the fatal impacts, user have to switch into the more powerful role: [SAMP:Administrator].
When this need is over (changes were made) user can again switch back to daily role [SAMP:Standard User]. This will decrease the potential danger to change unwanted settings in the day-to-day job.


|PR [URL:#top | TEXT: top]
|H3 [NAME:button] X. Buttons (editing)
Side by side with [VAR:Actions] there are the [VAR:Buttons]. Both have in fact very similar meaning: to react with the current [SAMP:Business Area] interface. In comparison with [VAR:Actions] (described above) the [VAR:Buttons] are more connected to the currently executing action:
[IMG:files/Basics/Buttons.png | WIDTH: 224px; | HEIGHT: 70px; ]
If user is editing some [SAMP:Business Entity] she/he can finally decide what to do (Save or Cancel).
Similar decisions exist on almost every page (filter or Clear parameters on the filter-screen etc.)
Some buttons also provides the [VAR:shortcut key]...


|PR [URL:#top | TEXT: top]
|H3 [NAME:view] XI. View selectors (page layout)
The common page layout could be not suitable for every situation. If user needs to print the detail, the areas around (Header, Navigation column ...) do not need to be seen.
For such situations there are 3 common Views available:
[IMG:files/Basics/View.png | WIDTH: 126px; | HEIGHT: 54px; ]
[LI
Default (with all that stuff around)
Detail (Useful for editing the large and complicated detail)
Print (no colors, no stuff around)
LI]

Suggested are always only two remaining views.
For every [SAMP:Business Entity] there could be made decision for the type of view on the [VAR:filter-screen].
[IMG:files/Basics/ListDetail.png]
This will affect the List-Detail navigation, if the current or some new window will be used to display the detail and in which view-type (Detail, Default, Print ...) it will be rendered [I:test it]

|PR [URL:#top | TEXT: top]
</Text>
    <HtmlText>&lt;h2&gt;
&lt;a name="top" &gt;&lt;/a&gt; The Application basic User interface overview&lt;/h2&gt;
&lt;p&gt;
Index&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="#appName" title="#appName" &gt;Application Name&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#logo" title="#logo" &gt;Logo&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#lang" title="#lang" &gt;Language and format selectors&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#quick" title="#quick" &gt;Quick Actions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#bread" title="#bread" &gt;Bread-crumb control&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#page" title="#page" &gt;Paging on the detail level&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#menu" title="#menu" &gt;Menu&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#action" title="#action" &gt;Actions &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#user" title="#user" &gt;User information&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#button" title="#button" &gt;Buttons (editing)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#view" title="#view" &gt;View selectors (page layout)&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src="/files/basics/AppOverview.png" alt="/files/basics/AppOverview.png" style="width: 686px;;height: 553px;;" /&gt;&lt;/p&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
&lt;a name="appName" &gt;&lt;/a&gt; I. Application Name&lt;/h3&gt;
&lt;p&gt;Application name (displayed in the upper left corner) describes the application. This text is also navigable and the click will redirect user to the Application home page.&lt;/p&gt;
&lt;p&gt;Text of the Application name could be adjusted in the &lt;samp&gt;Translator&lt;/samp&gt; management, by setting the entity with the key &lt;b&gt;&lt;i&gt;ApplicationName &lt;/i&gt;&lt;/b&gt;(this also allows the different naming for different cultures)&lt;/p&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
&lt;a name="logo" &gt;&lt;/a&gt; II. Logo&lt;/h3&gt;
&lt;p&gt;Company Logo provides the second quick way how to get to the Home page. Click on the Logo image will navigate the same way as the Application Name.&lt;/p&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
&lt;a name="lang" &gt;&lt;/a&gt; III. Language and format selectors&lt;/h3&gt;
&lt;p&gt;Application is by default ready to operate in multi-language mode. Users can select their &amp;#39;suitable&amp;#39; culture (by clicking the flag in the upper right corner).&lt;/p&gt;
&lt;p&gt;(E.g. &lt;img src="/i/en-GB.png" alt="/i/en-GB.png" style="float: left;;" /&gt; for British formatting and English phrases)&lt;/p&gt;
&lt;p&gt;Selected language has impact on Application behavior in two aspects:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Localizing the phrases (description of buttons, actions etc.)&lt;/li&gt;
&lt;li&gt;Date and Number formats&lt;/li&gt;
&lt;/ol&gt;
&lt;h5&gt;
Localization&lt;/h5&gt;
&lt;p&gt;The phrases localizing is in this application very simple, and can be maintained, changed and extended even in production environment.&lt;/p&gt;
&lt;p&gt;&lt;img src="/files/Basics/Localization.png" alt="/files/Basics/Localization.png" style="width: 117px;;height: 60px;;" /&gt;&lt;/p&gt;
&lt;p&gt;In the Menu (the TreeView on the left) you can select the &lt;samp&gt;Localization&lt;/samp&gt; sub-items&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Language&lt;/li&gt;
&lt;li&gt;Translator&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These two links will navigate user to the usual &lt;samp&gt;Business entities&lt;/samp&gt; management.&lt;/p&gt;
&lt;h6&gt;
Language&lt;/h6&gt;
&lt;p&gt;Languages can be simply added or removed. This has an impact on the offered languages set int upper right corner.&lt;/p&gt;
&lt;p&gt;When user selects the Language this way, Date and Number formats are adjusted to the selected culture standards.&lt;/p&gt;
&lt;p&gt;Selected Language also decides about the used phrases on the screen. If there is for example localized phrase for the &lt;dfn&gt;New&lt;/dfn&gt; (e.g. &amp;#39;Neu&amp;#39; in German) then it is used. In other cases, the default (usually the English) is used.&lt;/p&gt;
&lt;h6&gt;
Translator&lt;/h6&gt;
&lt;p&gt;Translator is (again) only the usual &lt;samp&gt;Business Entity&lt;/samp&gt;, providing the simple way for adjusting the User Interface.&lt;/p&gt;
&lt;p&gt;The next picture is an example of EDIT screen for the phrase of the &amp;#39;New&amp;#39; Key-word.&lt;/p&gt;
&lt;p&gt;&lt;img src="/files/Basics/Translator.png" alt="/files/Basics/Translator.png" style="width: 689px;;height: 353px;;" /&gt;&lt;/p&gt;
&lt;p&gt;For any combination (Key, Area) used in application could be the final phrase adjusted this way. The list of languages available in this editing screen depends on the &amp;#39;allowed&amp;#39; languages (described above).&lt;/p&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
&lt;a name="quick" &gt;&lt;/a&gt; IV. Quick Actions&lt;/h3&gt;
&lt;p&gt;There are &lt;var&gt;Actions&lt;/var&gt; available on every page. These are accessible by selecting the tab &amp;#39;Actions&amp;#39; in the left column. These are described in the section below &lt;a href="#action" title="#action" &gt;Actions &lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The mostly used &lt;var&gt;Actions&lt;/var&gt; have an abbreviated access in so called Quick actions menu:&lt;/p&gt;
&lt;p&gt;&lt;img src="/files/Basics/Quick.png" alt="/files/Basics/Quick.png" style="width: 229px;;height: 62px;;" /&gt;&lt;/p&gt;
&lt;p&gt;The actions on the picture are (from the left):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;New&lt;/li&gt;
&lt;li&gt;filter&lt;/li&gt;
&lt;li&gt;List view&lt;/li&gt;
&lt;li&gt;Export to Excel&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As the picture demonstrates, user can also execute these actions using the &lt;var&gt;shortcut key&lt;/var&gt;. For instance there is the &lt;dfn&gt; Shift + Alt + E&lt;/dfn&gt; to call &amp;#39;export to excel&amp;#39; action.&lt;/p&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
&lt;a name="bread" &gt;&lt;/a&gt; V. Bread-crumb control&lt;/h3&gt;
&lt;p&gt;Bread crumb control is the information area. It provides the assembled description about current page.&lt;/p&gt;
&lt;p&gt;&lt;img src="/files/Basics/Breadcrumb.png" alt="/files/Basics/Breadcrumb.png" style="width: 408px;;height: 37px;;" /&gt;&lt;/p&gt;
&lt;p&gt;For example (as shown on the picture) there are 4 parts describing the current page&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Application name - click on this hyperlink will navigate user to the home page&lt;/li&gt;
&lt;li&gt;Business Entity (ore business area) - click on this will navigate to the default page of current Business area&lt;/li&gt;
&lt;li&gt;Action name - currently executed action e.g. New, Edit, List ...&lt;/li&gt;
&lt;li&gt;&lt;i&gt;Optional&lt;/i&gt; is the Entity description (only on detail, or edit screens)&lt;/li&gt;
&lt;/ol&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
&lt;a name="page" &gt;&lt;/a&gt; VI. Paging on the detail level&lt;/h3&gt;
&lt;p&gt;The &lt;samp&gt;Business Entities&lt;/samp&gt; are in this application basically managed in so called CRUD steps:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;C - Create (New action)&lt;/li&gt;
&lt;li&gt;R - Read (filter and List)&lt;/li&gt;
&lt;li&gt;U - Update (Edit button)&lt;/li&gt;
&lt;li&gt;D - Delete&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;During the R step, user can use searching which results in the List view. The detail view can be easily accessed from the list view by clicking the found rows. To provide more smooth way to iterate the details&lt;/p&gt;
&lt;p&gt;and skipping these steps:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;i&gt;go to one detail&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;back to list&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;go to another detail&lt;/i&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src="/files/Basics/Paging.png" alt="/files/Basics/Paging.png" style="width: 172px;;height: 62px;;" /&gt;&lt;/p&gt;
&lt;p&gt;There are Paging (moving) buttons on the detail level. User therefore can directly navigate to the next or previous Entity. Of course, these actions are again accessible via &lt;var&gt;shortcut key&lt;/var&gt;&lt;/p&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
&lt;a name="menu" &gt;&lt;/a&gt; VII. Menu (main TreeView navigation)&lt;/h3&gt;
&lt;p&gt;The central navigation point is situated in the left column - TreeView Menu:&lt;/p&gt;
&lt;p&gt;&lt;img src="/files/Basics/Menu.png" alt="/files/Basics/Menu.png" style="width: 186px;;height: 332px;;" /&gt;&lt;/p&gt;
&lt;p&gt;Items of this tree are either (not navigable) Cluster Nodes (e.g. Business) which gathers similar &lt;var&gt;Items&lt;/var&gt; or the links to the Default pages of every available &lt;samp&gt;Business Area&lt;/samp&gt; (Entity).&lt;/p&gt;
&lt;p&gt;The offered menu items depend on the User access rights. For instance, if the user has the &lt;dfn&gt;Administrator&lt;/dfn&gt; role, there is the Administration Cluster node. Without such right, the Menu does not display this item at all.&lt;/p&gt;
&lt;p&gt;At any place of the application user can RIGHT click on the link (even in the TreeView menu) and select &amp;#39;Open in the new Window or Tab&amp;#39;. This will enable to operate with different parts of the application in different windows. There is no limitation about this feature.&lt;/p&gt;
&lt;p&gt;&lt;i&gt;Users are also allowed to click the &lt;var&gt;BACK&lt;/var&gt; button of the browser to return to previously edited screen. This approach will have no impact to previously stored changes; it only allowes to go back and start new navigation from some of the previously seen page&lt;/i&gt;.&lt;/p&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
&lt;a name="action" &gt;&lt;/a&gt; VIII. Actions&lt;/h3&gt;
&lt;p&gt;Every &lt;samp&gt;Business Area&lt;/samp&gt; has the default view. For Entities it is usually the list view (unless the users during the development decided to change this behavior).&lt;/p&gt;
&lt;p&gt;From that point user can interact whit the application using the proposed actions:&lt;/p&gt;
&lt;p&gt;&lt;img src="/files/Basics/Actions.png" alt="/files/Basics/Actions.png" style="width: 188px;;height: 208px;;" /&gt;&lt;/p&gt;
&lt;p&gt;These are available (all of them) in the Left navigation column below the &lt;var&gt;Actions Tab&lt;/var&gt;.&lt;/p&gt;
&lt;p&gt;The frequently used actions are also available in the &lt;a href="#quick" title="#quick" &gt;Quick action icon list&lt;/a&gt;.&lt;/p&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
&lt;a name="user" &gt;&lt;/a&gt; IX. User information&lt;/h3&gt;
&lt;p&gt;User name and login (used for authorization) are displayed in the User information area:&lt;/p&gt;
&lt;p&gt;&lt;img src="/files/Basics/User.png" alt="/files/Basics/User.png" style="width: 192px;;height: 95px;;" /&gt;&lt;/p&gt;
&lt;p&gt;Also the currently applied &lt;a href="#lang" title="#lang" &gt;Language and Culture&lt;/a&gt; (date and number formatting) are displayed. If application is using the &lt;dfn&gt;Current role approach&lt;/dfn&gt; - User Information area also contains the link to the &lt;var&gt;Role selector&lt;/var&gt; (Just test it).&lt;/p&gt;
&lt;p&gt;The &lt;dfn&gt;Current role approach&lt;/dfn&gt; has one essential advantage for users: They can act with application in different roles e.g.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;samp&gt;Administrator&lt;/samp&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;Standard User&lt;/samp&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Whenever there is need to execute &lt;i&gt;potentially dangerous&lt;/i&gt; actions (change user rights, remove user) which could lead to the fatal impacts, user have to switch into the more powerful role: &lt;samp&gt;Administrator&lt;/samp&gt;.&lt;/p&gt;
&lt;p&gt;When this need is over (changes were made) user can again switch back to daily role &lt;samp&gt;Standard User&lt;/samp&gt;. This will decrease the potential danger to change unwanted settings in the day-to-day job.&lt;/p&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
&lt;a name="button" &gt;&lt;/a&gt; X. Buttons (editing)&lt;/h3&gt;
&lt;p&gt;Side by side with &lt;var&gt;Actions&lt;/var&gt; there are the &lt;var&gt;Buttons&lt;/var&gt;. Both have in fact very similar meaning: to react with the current &lt;samp&gt;Business Area&lt;/samp&gt; interface. In comparison with &lt;var&gt;Actions&lt;/var&gt; (described above) the &lt;var&gt;Buttons&lt;/var&gt; are more connected to the currently executing action:&lt;/p&gt;
&lt;p&gt;&lt;img src="/files/Basics/Buttons.png" alt="/files/Basics/Buttons.png" style="width: 224px;;height: 70px;;" /&gt;&lt;/p&gt;
&lt;p&gt;If user is editing some &lt;samp&gt;Business Entity&lt;/samp&gt; she/he can finally decide what to do (Save or Cancel).&lt;/p&gt;
&lt;p&gt;Similar decisions exist on almost every page (filter or Clear parameters on the filter-screen etc.)&lt;/p&gt;
&lt;p&gt;Some buttons also provides the &lt;var&gt;shortcut key&lt;/var&gt;...&lt;/p&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
&lt;a name="view" &gt;&lt;/a&gt; XI. View selectors (page layout)&lt;/h3&gt;
&lt;p&gt;The common page layout could be not suitable for every situation. If user needs to print the detail, the areas around (Header, Navigation column ...) do not need to be seen.&lt;/p&gt;
&lt;p&gt;For such situations there are 3 common Views available:&lt;/p&gt;
&lt;p&gt;&lt;img src="/files/Basics/View.png" alt="/files/Basics/View.png" style="width: 126px;;height: 54px;;" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Default (with all that stuff around)&lt;/li&gt;
&lt;li&gt;Detail (Useful for editing the large and complicated detail)&lt;/li&gt;
&lt;li&gt;Print (no colors, no stuff around)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Suggested are always only two remaining views.&lt;/p&gt;
&lt;p&gt;For every &lt;samp&gt;Business Entity&lt;/samp&gt; there could be made decision for the type of view on the &lt;var&gt;filter-screen&lt;/var&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src="/files/Basics/ListDetail.png" alt="/files/Basics/ListDetail.png" style="" /&gt;&lt;/p&gt;
&lt;p&gt;This will affect the List-Detail navigation, if the current or some new window will be used to display the detail and in which view-type (Detail, Default, Print ...) it will be rendered &lt;i&gt;test it&lt;/i&gt;&lt;/p&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
</HtmlText>
  </Article>
  <Article ID="2" CreationDate="2011-05-25T12:34:56.7" LastUpdateDate="2013-05-02T16:37:09.4475266+02:00" ReleaseDate="2010-08-25T12:34:56.7" IsVisible="false" ShowComment="false" Code="Administration" Title="How to manage application" Description="Users and rights management, Roles in the application." ArticleCategoryId="2" ArticleGroupId="2">
    <Text>|H2 [NAME:top] The Application administration

|P Index
[NUM
[URL:#current | TEXT:Current Role]
[URL:#admin   | TEXT:Administration]
[URL:#user    | TEXT:User]
NUM]


|PR [URL:#top | TEXT: top]
|H3 [NAME:current] I. Current Role

The [DFN:Current role approach] has one essential advantage for users: They can act with application in different roles e.g.
[LI
[SAMP:Administrator]
[SAMP:Standard User]
LI]
Whenever there is need to execute [I:potentially dangerous] actions (change user rights, remove user) which could lead to the fatal impacts, user have to switch into the more powerful role: [SAMP:Administrator].
When this need is over (changes were made) user can again switch back to daily role [SAMP:Standard User]. This will decrease the potential danger to change unwanted settings in the day-to-day job.

|H5 How to change [DFN:Current role]
Next picture in the left bottom corner provides the information about currently selected role ([SAMP:Administrator] in this case - mared 'I.')
[IMG:files/Administration/ChangeRole.png]

I.   Click on the currently selected role link (left bottom corner, e.g. Administrator - 'I.')
II.  Click on the button (marked with II.) to get the role list
III. Select intended role (e.g. Administrator for more powerful rights)
IV.  Save the newly selected role - click the [VAR:Select application role] button marked with 'IV.'

This approach is available for every user of the application. Only the list of accessible roles depends on the User settings (see [URL:#admin   | TEXT:Administration])

The Menu items now should be different. Each role has different rights and therefore different Menu-items.


|PR [URL:#top | TEXT: top]
|H3 [NAME:admin] II. Administration (menu item)

Administration contains the User management and optionally Application specific settings. This management is available in the Menu Item called [VAR:Administration] (marked with 'I.' on the picture below)

[IMG: files/Administration/AdminSelection.png ]

If there is NOT [VAR:Administration] menu item displayed, then User must switch to the [SAMP:Administrator] role (if there is such an option for this User). (See [URL:#current | TEXT:Current Role])

When successfully switched to the [DFN:Current role] -&gt; [SAMP:Administrator], there will be the Menu Item 'Administration' available with User management as displayed on the next picture
[IMG:files/Administration/UserManage.png]

How to Manage user (add, change the rights) is described in the section [URL:#user    | TEXT:User].

|PR [URL:#top | TEXT: top]
|H3 [NAME:user] II. User

User is a standard Business Entity (in the manner of its management). Users can be added, changed and removed. To enter the User management select the User menu item in the Administration node (see the picture below). The default (enter) screen for User management is the list - overview of all already existing users.
[IMG:files/Administration/UserList.png]

To add new User to the Application, click the quick Icon [IMG:i/quick/new.png] or use the [VAR:shortcut key] Shift + Alt + N. The editing screen will appear:
[IMG:files/Administration/UserNew.png]

Every User-Entity is unique by its Login property (Another entity could have unique Code etc.).
For purposes of this application it is the Windows authenticated [VAR:Login] without the domain (e.g. wrong [BLUE:[S:PCNAME\UserLogin]], right [PURPLE:[U:UserLogin]])

Finally click the Add button or use the [VAR:shortcut key] Shift + Alt + S. This will store the newly created User record with the rights - in our case [SAMP:Viewer]. The 'Viewer' role will allow user to see some parts of application - always in the READONLY mode.

The list of Users will now display two records (the new row marked with 'II.'). Also Observe the headers which allow to sort, simply click.
[IMG:files/Administration/UserList2.png]
Every list view also provides the direct Excel exporting. You can either click the Excel sheet icon  [IMG:i/quick/listToExcel.png] or use the [VAR:shortcut key] Shift + Alt + E.

Click on the row will navigate to the 'detail' view or to the 'edit' view (the 'Edit' column in the list view). Then selected enity can be changed, in the same way as it was newly added.


This entity management is very simple. There are no hidden but. Similar behavior is applied on any other [DFN:Business entity] management in the application.

|PR [URL:#top | TEXT: top]
</Text>
    <HtmlText>&lt;h2&gt;
&lt;a name="top" &gt;&lt;/a&gt; The Application administration&lt;/h2&gt;
&lt;p&gt;
Index&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="#current" title="#current" &gt;Current Role&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#admin" title="#admin" &gt;Administration&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#user" title="#user" &gt;User&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
&lt;a name="current" &gt;&lt;/a&gt; I. Current Role&lt;/h3&gt;
&lt;p&gt;The &lt;dfn&gt;Current role approach&lt;/dfn&gt; has one essential advantage for users: They can act with application in different roles e.g.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;samp&gt;Administrator&lt;/samp&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;Standard User&lt;/samp&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Whenever there is need to execute &lt;i&gt;potentially dangerous&lt;/i&gt; actions (change user rights, remove user) which could lead to the fatal impacts, user have to switch into the more powerful role: &lt;samp&gt;Administrator&lt;/samp&gt;.&lt;/p&gt;
&lt;p&gt;When this need is over (changes were made) user can again switch back to daily role &lt;samp&gt;Standard User&lt;/samp&gt;. This will decrease the potential danger to change unwanted settings in the day-to-day job.&lt;/p&gt;
&lt;h5&gt;
How to change &lt;dfn&gt;Current role&lt;/dfn&gt;&lt;/h5&gt;
&lt;p&gt;Next picture in the left bottom corner provides the information about currently selected role (&lt;samp&gt;Administrator&lt;/samp&gt; in this case - mared &amp;#39;I.&amp;#39;)&lt;/p&gt;
&lt;p&gt;&lt;img src="/files/Administration/ChangeRole.png" alt="/files/Administration/ChangeRole.png" style="" /&gt;&lt;/p&gt;
&lt;p&gt;I.&amp;nbsp;&amp;nbsp; Click on the currently selected role link (left bottom corner, e.g. Administrator - &amp;#39;I.&amp;#39;)&lt;/p&gt;
&lt;p&gt;II.&amp;nbsp;&amp;nbsp;Click on the button (marked with II.) to get the role list&lt;/p&gt;
&lt;p&gt;III. Select intended role (e.g. Administrator for more powerful rights)&lt;/p&gt;
&lt;p&gt;IV.&amp;nbsp;&amp;nbsp;Save the newly selected role - click the &lt;var&gt;Select application role&lt;/var&gt; button marked with &amp;#39;IV.&amp;#39;&lt;/p&gt;
&lt;p&gt;This approach is available for every user of the application. Only the list of accessible roles depends on the User settings (see &lt;a href="#admin" title="#admin" &gt;Administration&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;The Menu items now should be different. Each role has different rights and therefore different Menu-items.&lt;/p&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
&lt;a name="admin" &gt;&lt;/a&gt; II. Administration (menu item)&lt;/h3&gt;
&lt;p&gt;Administration contains the User management and optionally Application specific settings. This management is available in the Menu Item called &lt;var&gt;Administration&lt;/var&gt; (marked with &amp;#39;I.&amp;#39; on the picture below)&lt;/p&gt;
&lt;p&gt;&lt;img src="/files/Administration/AdminSelection.png" alt="/files/Administration/AdminSelection.png" style="" /&gt;&lt;/p&gt;
&lt;p&gt;If there is NOT &lt;var&gt;Administration&lt;/var&gt; menu item displayed, then User must switch to the &lt;samp&gt;Administrator&lt;/samp&gt; role (if there is such an option for this User). (See &lt;a href="#current" title="#current" &gt;Current Role&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;When successfully switched to the &lt;dfn&gt;Current role&lt;/dfn&gt; -&amp;gt; &lt;samp&gt;Administrator&lt;/samp&gt;, there will be the Menu Item &amp;#39;Administration&amp;#39; available with User management as displayed on the next picture&lt;/p&gt;
&lt;p&gt;&lt;img src="/files/Administration/UserManage.png" alt="/files/Administration/UserManage.png" style="" /&gt;&lt;/p&gt;
&lt;p&gt;How to Manage user (add, change the rights) is described in the section &lt;a href="#user" title="#user" &gt;User&lt;/a&gt;.&lt;/p&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
&lt;a name="user" &gt;&lt;/a&gt; II. User&lt;/h3&gt;
&lt;p&gt;User is a standard Business Entity (in the manner of its management). Users can be added, changed and removed. To enter the User management select the User menu item in the Administration node (see the picture below). The default (enter) screen for User management is the list - overview of all already existing users.&lt;/p&gt;
&lt;p&gt;&lt;img src="/files/Administration/UserList.png" alt="/files/Administration/UserList.png" style="" /&gt;&lt;/p&gt;
&lt;p&gt;To add new User to the Application, click the quick Icon &lt;img src="/i/quick/new.png" alt="/i/quick/new.png" style="" /&gt; or use the &lt;var&gt;shortcut key&lt;/var&gt; Shift + Alt + N. The editing screen will appear:&lt;/p&gt;
&lt;p&gt;&lt;img src="/files/Administration/UserNew.png" alt="/files/Administration/UserNew.png" style="" /&gt;&lt;/p&gt;
&lt;p&gt;Every User-Entity is unique by its Login property (Another entity could have unique Code etc.).&lt;/p&gt;
&lt;p&gt;For purposes of this application it is the Windows authenticated &lt;var&gt;Login&lt;/var&gt; without the domain (e.g. wrong &lt;span style="color:Blue;" &gt;&lt;del&gt;PCNAME\UserLogin&lt;/del&gt;&lt;/span&gt;, right &lt;span style="color:Purple;" &gt;&lt;ins&gt;UserLogin&lt;/ins&gt;&lt;/span&gt;)&lt;/p&gt;
&lt;p&gt;Finally click the Add button or use the &lt;var&gt;shortcut key&lt;/var&gt; Shift + Alt + S. This will store the newly created User record with the rights - in our case &lt;samp&gt;Viewer&lt;/samp&gt;. The &amp;#39;Viewer&amp;#39; role will allow user to see some parts of application - always in the READONLY mode.&lt;/p&gt;
&lt;p&gt;The list of Users will now display two records (the new row marked with &amp;#39;II.&amp;#39;). Also Observe the headers which allow to sort, simply click.&lt;/p&gt;
&lt;p&gt;&lt;img src="/files/Administration/UserList2.png" alt="/files/Administration/UserList2.png" style="" /&gt;&lt;/p&gt;
&lt;p&gt;Every list view also provides the direct Excel exporting. You can either click the Excel sheet icon&amp;nbsp;&amp;nbsp;&lt;img src="/i/quick/listToExcel.png" alt="/i/quick/listToExcel.png" style="" /&gt; or use the &lt;var&gt;shortcut key&lt;/var&gt; Shift + Alt + E.&lt;/p&gt;
&lt;p&gt;Click on the row will navigate to the &amp;#39;detail&amp;#39; view or to the &amp;#39;edit&amp;#39; view (the &amp;#39;Edit&amp;#39; column in the list view). Then selected enity can be changed, in the same way as it was newly added.&lt;/p&gt;
&lt;p&gt;This entity management is very simple. There are no hidden but. Similar behavior is applied on any other &lt;dfn&gt;Business entity&lt;/dfn&gt; management in the application.&lt;/p&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
</HtmlText>
  </Article>
  <Article ID="3" CreationDate="2011-05-25T12:34:56.7" LastUpdateDate="2013-05-02T16:37:13.0715266+02:00" ReleaseDate="2010-08-25T12:34:56.7" IsVisible="true" ShowComment="false" Code="Wiki" Title="Wiki .NET Syntax" Description="Description of the Wiki .NET Syntax. How to write headers, text, hyper-links, append images and zipped files and many more. Every element is described and provided with sample code. &#xD;&#xA;The major intention of the Wiki .NET Syntax was to provide as easy way to describe text as possible. Once this target is fit, then Wiki .NET Parser can be used in a day to day practice." ArticleCategoryId="2" ArticleGroupId="2">
    <Text>|H1 WIKI.NET [NAME:top]

[NUM
[URL:#simpleText|TEXT: Simple Text]
[URL:#paragraph|TEXT: Headers and Paragraphs]
[URL:#lists|TEXT: Lists] [GREEN:[I:(extended)]]
[URL:#navigation|TEXT: Navigation]  [GREEN:[I:(fixed for long url)]]
[URL:#image|TEXT: Image]
[URL:#decoration|TEXT: Decorations and Colors]  [GREEN:[I:(extended)]]
[URL:#block|TEXT: Block]
[URL:#escaped|TEXT: Escaped character syntax]
[URL:#tables|TEXT: Tables]  [GREEN:[I:(new)]]
NUM]


|H2 Notes
|P1 This document is written in the [B:[GREEN:Wiki .NET]] Syntax and converted with the [B:[GREEN:Wiki .NET Parser]]  (and therefore could be taken as a proof of concept).
|P1 [B:[GREEN:WIKI.NET]] is based on the ANTLR3 for C#.NET. Very few rows of the lexer, grammar and AST Parser; future extensibility; easy maintainability; exceptional performance
|P1 Syntax of the [B:[GREEN:Wiki .NET]] is (from the highlighting point of view) mostly C# and XML oriented.
|P1 In next paragraphs there is complete description of the syntax with examples. Syntax elements could be split into these categories:

[LI
Blocks (special formatting like XML)
Inline Blocks (text)
Decoration (styles, colors)
Hyperlinks and images
LI]

|P1 As in another languages there is a small set of the special leading characters used in [B:[GREEN:Wiki .NET]] Syntax:
[LI
[SAMP:[PURPLE:[[]]] (opening block)
[SAMP:[PURPLE:[]]]] (closing block)
[SAMP:[PURPLE:[|]]] (inline block; attribute separator)
[SAMP:[PURPLE:[:]]] (attribute value starts)
LI]
|P1 These signs combined with keywords provides complete [B:[GREEN:Wiki .NET]] playground for safe text publishing.




|H2 [NAME:simpleText] Simple Text
|PR [URL:#top | TEXT: top]



|H3 Keywords
[LI
[SAMP:[I:(there are NO keywords)]]
LI]

|H3 Description
|P1 You can type text as it goes. It will be rendered as usual text without any formatting.

|P1 The newlines (ENTER) will be rendered as a html specific new lines (instead of "\r\n" - "&lt;br /&gt;").

|P1 More Spaces (more then 1) will be all rendered (not skipped). [I: (Standard HTML browser will convert multi-space into single one)]

|P1 Empty lines are skipped. To append empty line to the output, place the White space on the line [I:(white space and press ENTER)]

|H3 Syntax
[CODE
There is no special syntax, just type...

CODE]

|H3 Example

|H4 wiki
[CODE
1) Text with the
broken lines
2) Text with    spaces
CODE]

|H4 result
[BQ
1) Text with the
broken lines
2) Text with    spaces
BQ]










|H2 [NAME:paragraph] Headers and Paragraph
|PR [URL:#top | TEXT: top]




|P Headers and Paragraphs has the syntax based on 3 parts
[NUM
[SAMP:[BLUE:[|]]] Leading vertical line at the beginning
[SAMP:[BLUE:H1]] The name of the used header or paragraph
[SAMP:[BLUE:' ']] One WHITE SPACE!
NUM]
|H3 Keywords
[LI
[SAMP:[PURPLE:[|]H1 .. [|]H6 ]  ](headers)
[SAMP:[PURPLE:[|]P ]          ](paragraph)
[SAMP:[PURPLE:[|]P1 .. [|]P3 ]  ](paragraphs with different margins)
[SAMP:[PURPLE:[|]PC ]         ](center aligned paragraph)
[SAMP:[PURPLE:[|]PR ]         ](right aligned paragraph)
[SAMP:[PURPLE:[|]CITE ]       ](cite text (italic))
[SAMP:[PURPLE:[|]BQ ]         ](blockquote text with larger padding)
LI]

|H3 Description

|P1 Headers and Paragraphs allows formatting based on 'inline block' style.

|P1 It means, that the text between the opening symbol (e.g. '[SAMP:[PURPLE:[|]P ]]' and the end of line [I:(ENTER)] is rendered as a paragraph &lt;p&gt;...&lt;/p&gt;)


|H3 Syntax
[CODE
[PURPLE:[|]H1 ] Header 1
- &gt; &lt;h6&gt;Header 1 &lt;/h6&gt;
..
[PURPLE:[|]H6 ] Header 6
- &gt; &lt;h6&gt;Header 6&lt;/h6&gt;

[PURPLE:[|]P ] Usuall text...
- &gt; &lt;p&gt;Usuall text...&lt;/p&gt;

CODE]

|H3 Example

|H4 wiki
[CODE
[PURPLE:[|]H3 ] Lorem ipsum
[PURPLE:[|]P1 ] Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed dor eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

[PURPLE:[|]P2 ] Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum


[PURPLE:[|]CITE ] Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.

[PURPLE:[|]BQ ] Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.

[PURPLE:[|]PR ] Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.

CODE]

|H4 result
[BQ

|H3 Lorem ipsum
|P1 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed dor eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

|P2 Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum

|CITE Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.

|BQ Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.

|PR Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.

BQ]






|H2 [NAME:lists] Lists
|PR [URL:#top | TEXT: top]


|P1 There are two types of lists. Wrapped and inline, for both 'numbered' and 'pointed' types.

|H3 Keywords
Block syntax, uses starting and closing tags LI or/and NUM to wrap selected rows as list items.
[LI
[SAMP:'[[]LI'   'LI[]]'  ]
[SAMP:'[[]NUM'  'NUM[]]'  ]
LI]

Inline syntax will render every row as a list item if starting with one of below statements (the space sign after asterix or hash is important)
[LI
[SAMP:'* ']
[SAMP:'** ']
[SAMP:'*** ']
[SAMP:'# ']
[SAMP:'## ']
[SAMP:'### ']
LI]

|H3 Description
|P1 You can choose block or inline style. Block lists can be nested. Inline syntax must be correctly growing (cannot start with '** ')


|H3 Block Syntax
[CODE
[PURPLE:[[]LI ]
meals
colors
[PURPLE:[[]NUM ]
blue
red
[PURPLE: NUM[]]]
[PURPLE: LI[]]]
CODE]

|H3 Inline Syntax
[CODE
[PURPLE:* ] meals
[PURPLE:* ] colors
[PURPLE:## ] blue
[PURPLE:## ] read
CODE]

|H3 Result for both
[CODE
&lt;ul&gt;
&lt;li&gt;meals&lt;/li&gt;
&lt;li&gt;colors
&lt;ol&gt;
 &lt;li&gt;blue&lt;/li&gt;
 &lt;li&gt;red&lt;/li&gt;
&lt;/ol&gt;&lt;/li&gt;
&lt;ul&gt;
CODE]


|H3 Example

|H4 wiki
[CODE
 // blocks
[PURPLE:[[]LI ]
Meals:
Supported colors are:
[PURPLE:[[]NUM ]
blue
red
green
[PURPLE:NUM[]]]
[PURPLE: LI[]]]
 // inlines
[*] Meals:
[*] Supported colors are:
[#]# blue
[#]# red
[#]# green
CODE]

|H4 result
[BQ
 // blocks
[LI Meals:
Supported colors are:
[NUM blue
red
green NUM]
LI]
 // inlines
* Meals:
* Supported colors are:
## blue
## red
## green

BQ]










|H2 [NAME:navigation] Navigation
|PR [URL:#top | TEXT: top]





|H3 Keywords
[LI
[SAMP:[PURPLE:URL]]
[SAMP:[PURPLE:URL [|] TEXT]]
[SAMP:[PURPLE:NAME]]
LI]
|H3 Description

|P1 There are two keywords: [SAMP:URL] and [SAMP:NAME] for creating the hyperlinks.

|P1 The first [I:([SAMP:URL])] will result in the hyperlink with the [V:href] attribute (where to navigate). There are few different ways how to change the text of the hyperlink, if the [VAR:url] itself is not suitable (e.g. [DFN:&lt;a href="target"&gt;target&lt;/a&gt;] to [DFN:&lt;a href="target"&gt;my TEXT&lt;/a&gt;])

|P1 The second will create the anchor  [I:([SAMP:NAME])] to which could be page scrolled [I:(e.g. the 'top' hyperlinks navigating to the top of the page)]

|H3 Syntax URL
[CODE

[PURPLE:[[]URL:index.htm#top]] // only url
==&gt; &lt;a ref="index.htm#top"&gt;index.htm#top&lt;/a&gt;

[PURPLE:[[]URL: click here [|] index.htm#top]]          // short text first
==&gt; &lt;a ref="index.htm#top" &gt;click here&lt;/a&gt; // then vline '|' and url


// OR
[PURPLE:[[]URL:  index.htm#top [|]TEXT: click here]]    // first url
==&gt; &lt;a ref="index.htm#top" &gt;click here&lt;/a&gt; // then attr '|TEXT:' and text

[PURPLE:[[]URL: ["]index.htm#top["] [|]TEXT: click here]]   // quoted url (if too long and complicated url)
==&gt; &lt;a ref="index.htm#top" &gt;click here&lt;/a&gt; // |TEXT: next with an attr 'TEXT:'


CODE]

|H3 Syntax NAME
[CODE
[PURPLE:[[]NAME:top]]
- &lt;a name="top"&gt;&lt;/a&gt;
CODE]

|H3 Example

|H4 Wiki
[CODE
[PURPLE:[[]URL:#top]]   - only url
[PURPLE:[[]URL:TOP [|] #top]]  - text first


[PURPLE:[[]URL: #top  [|]TEXT: TOP]] - TEXT: attribute
[PURPLE:[[]URL:["]#top["] [|]TEXT: TOP]] - quoted url

CODE]
|H4 Result

[BQ
[URL:#top]  - only url
[URL:TOP|#top] - short text first


[URL:#top|TEXT:TOP]  - TEXT: attribute
[URL:"#top"|TEXT:TOP]  - quoted url
BQ]








|H2 [NAME:image] Image
|PR [URL:#top | TEXT: top]





|H3 Keywords
[LI
[SAMP:[PURPLE:IMG]]
[SAMP:[PURPLE:HEIGHT]]
[SAMP:[PURPLE:WIDTH]]
[SAMP:[PURPLE:FLOAT]]
LI]

|H3 Description
|P1 [SAMP:[PURPLE:IMG]] element allows you to insert the image into to the page.

|P1 The URL for image should be relative, for instance 'i/cs.png'

|P1 There is an issue with the virtual directories for applications. E.g. instead of [I:http://mydomain/] there is [I:http://mydomain/myvirtualdir/]. In these situations there is a background call which will change the IMG src attribute from  [S:[RED:'i/cs.png']] to  [GREEN:'myvirtualdir/i/cs.png'] and the image will be correctly displayed.

|H3 Syntax
[CODE
[PURPLE:[[]IMG:i/cs.png[]]]
==&gt; &lt;img src="i/cs.png" /&gt;

[PURPLE:[[]IMG:i/cs.png [|]HEIGHT:100px[|]WIDTH:80px[]]]
==&gt; &lt;img src="i/cs.png" style="height:100px;width:80px;" /&gt;

[PURPLE:[[]IMG:i/cs.png [|]FLOAT:right[]]]
==&gt; &lt;img src="i/cs.png" style="float:right;" /&gt;

CODE]

|H3 Example

|H4 wiki
[CODE

[PURPLE:[|]P1 ] Lorem ipsum dolor [PURPLE:[[]IMG:i/cs.png[]]]  sit amet, consectetur adipisicing elit, sed dor eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

[PURPLE:[|]P2 ] Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. [PURPLE:[[]IMG:i/cs.png[|]HEIGHT:100px[|] WIDTH:80px[]]]  Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum

[PURPLE:[|]P3 ] Sed [PURPLE:[[]IMG:i/cs.png[|]FLOAT:right[]]]  ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.


CODE]

|H4 result
[BQ

|P1 Lorem ipsum dolor [IMG:i/cs.png]  sit amet, consectetur adipisicing elit, sed dor eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.


|P2 Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. [IMG:i/cs.png |HEIGHT:100px| WIDTH:80px]  Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum

|P3 Sed [IMG:i/cs.png|FLOAT:right] ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.

BQ]







|H2 [NAME:decoration] Decorations and Colors
|PR [URL:#top | TEXT: top]




|H3 Keywords
[B: Special bold and italic:]
[LI
[SAMP: [*]bold text[*]   ]*bold text*
[SAMP: [_]italic text[_] ] _italic text_
LI]

[B: Decorations:]
[LI
[SAMP:[PURPLE:B]     ][B:bold]
[SAMP:[PURPLE:I]     ][I:italic]
[SAMP:[PURPLE:U]     ][U:underline]
[SAMP:[PURPLE:S]     ][S:striked]
[SAMP:[PURPLE:V]     ][V:variable]
[SAMP:[PURPLE:SAMP]  ][SAMP:sample]
[SAMP:[PURPLE:BIG]   ][BIG:big]
[SAMP:[PURPLE:SMALL] ][SMALL:small]
[SAMP:[PURPLE:SUP]   ]sup [SUP:*sup]
[SAMP:[PURPLE:SUB]   ]sub [SUB:*sub]
LI]

[B: Colors:]
[LI
[SAMP:[PURPLE:BLUE]   ][BLUE:blue]
[SAMP:[PURPLE:RED]    ][RED:red]
[SAMP:[PURPLE:GREEN]  ][GREEN:green]
[SAMP:[PURPLE:OLIVE]  ][OLIVE:olive]
[SAMP:[PURPLE:LIME]   ][LIME:lime]
[SAMP:[PURPLE:PURPLE] ][PURPLE:purple]
[SAMP:[PURPLE:YELLOW] ][YELLOW:yellow]
[SAMP:[PURPLE:MAROON] ][MAROON:maroon]
[SAMP:[PURPLE:SILVER] ][SILVER:silver]
[SAMP:[PURPLE:ORANGE] ][ORANGE:orange]
[SAMP:[PURPLE:NAVY]   ][NAVY:navy]
[SAMP:[PURPLE:PINK]   ][PINK:pink]
LI]

|H3 Description
|P1 Decoration styles and colors are 'inline' elements. This means that these elements cannot contain new lines!

|P1 You can use them almost anywhere and if needed they can be even nested (e.g. bold and blue)

|H3 Syntax
[CODE
// bold and italic inside some row
.. not bold [*]now bold until here[*] not bold ..
==&gt; .. not bold &lt;b&gt;now bold until here&lt;/b&gt; not bold ..

.. not italic [_]now italic until here[_] not italic ..
==&gt; .. not italic &lt;i&gt;now italic until here&lt;/i&gt; not italic ..

// bold and italic
[PURPLE:[[]B:bold[]]]
==&gt; &lt;b&gt;bold&lt;/b&gt;

[PURPLE:[[]I:italic[]]]
==&gt; &lt;i&gt;italic&lt;/i&gt;


// COLOR example: blue and purple
[PURPLE:[[]BLUE:blue[]]]
- &gt; &lt;span style="color:blue;"
&gt;blue&lt;/span&gt;
[PURPLE:[[]PURPLE:purple[]]]
- &gt; &lt;span style="color:purple;"
&gt;purple&lt;/span&gt;

CODE]

|H3 Example

|H4 wiki
[CODE
[PURPLE:[|]CITE] This text could be partially [PURPLE:[[]B:]bold end even [PURPLE:[[]ORANGE:]orange[PURPLE:[]][]]]. And that all inside the big [PURPLE:[[]BIG:]CITE[PURPLE:[]]] element.
CODE]

|H4 result
[BQ
|CITE This text could be partially [B:bold end even [ORANGE:orange]]. And that all inside the [BIG:CITE] element.
BQ]






|H2 [NAME:block] Block
|PR [URL:#top | TEXT: top]



|P1 There are 3 special block elements for specific text rendering: CODE, XML, HTML. There is also the BlockQuote element: BQ.

|H3 Keywords
[LI
[SAMP:[PURPLE:CODE ]  ][I:C# syntax support]
[SAMP:[PURPLE:XML ]   ][I:xml syntax support]
[SAMP:[PURPLE:HTML ]  ][I:html specific syntax support]
[SAMP:[PURPLE:BQ ]    ][I:support for multi-line blockquote]
[SAMP:[PURPLE:PRE ]   ][I:renders PRE element]
LI]

|H3 Description

|P1 These block elementshas the special syntax which has OPENING and CLOSING tags. The text placed between the CODE, XML, HTML marks is rendered with special syntax support.

|P1 Usage of these element is extremely simple: just copy your code, and place it between [PURPLE:[[]CODE CODE[]]] elements. That's all


|H3 Syntax
[CODE
[PURPLE:[[]CODE ]
public interface IModel {}
[PURPLE:CODE[]]]
- &gt; &lt;code&gt;
&lt;span class="base" &gt;public&lt;/span&gt;
&lt;span class="base" &gt;interface&lt;/span&gt;
IModel&lt;br /&gt;
&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;

&lt;span class="cmmnt"
&gt;// TODO&lt;/span&gt;&lt;br /&gt;
&lt;span class="smbl" &gt;}&lt;/span&gt;&lt;br /&gt;
&lt;/code&gt;

CODE]

|H3 Example

|H4 wiki
[CODE

[PURPLE:[|]H5 ] CODE

[PURPLE:[[]CODE ]
public interface IModel
{
// TODO
}
[PURPLE:CODE[]]]


[PURPLE:[|]H5] XML

[PURPLE:[[]XML ]
&lt;project&gt;
  &lt;settings&gt;
    &lt;mode value="Leveled"
       type="Fluent" /&gt;
    &lt;readability name="Inner" &gt;
      &lt;!-- TODO --&gt;
      ... extended in the next phase ...
    &lt;/readability&gt;
  &lt;/settings&gt;
&lt;/project&gt;
[PURPLE:XML[]] ]


[PURPLE:[|]H5] HTML

[PURPLE:[[]HTML ]
&lt;html xmlns="http://www.w3.org/1999/xhtml" &gt;
  &lt;head&gt;
    &lt;title&gt;&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;a href="Index.htm" &gt;
      Default&lt;/a&gt;
  &lt;/body&gt;
&lt;/html&gt;
[PURPLE:HTML[]] ]

CODE]



|H4 result
[BQ

|H5 CODE

[CODE
public interface IModel
{
   // TODO
}
CODE]


|H5 XML
[XML
&lt;project&gt;
  &lt;settings&gt;
    &lt;mode value="Leveled"
        type="Fluent" /&gt;
    &lt;readability name="Inner" &gt;
        &lt;!-- TODO --&gt;
        extended in the next phase
    &lt;/readability&gt;
  &lt;/settings&gt;
&lt;/project&gt;
XML]


|H5  HTML

[HTML
&lt;html xmlns="http://www.w3.org/1999/xhtml" &gt;
  &lt;head&gt;
    &lt;title&gt;&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;a href="Index.htm" &gt;
    Default&lt;/a&gt;
  &lt;/body&gt;
&lt;/html&gt;
HTML]


BQ]



|H2 [NAME:escaped] Escaped character syntax
|PR [URL:#top | TEXT: top]


|P1 There are some special characters used for this wiki markup. They are [B:leading symbols] and therefore cannot be used directly in the text

|P1 If they are used directly (without escaping) they could result in unwanted streams; or even break the whole page.

|H3 Keywords
[LI
[SAMP:[PURPLE:[[] ]]
[SAMP:[PURPLE:[]] ]]
[SAMP:[PURPLE:[|] ]]
[SAMP:[PURPLE:[:] ]]
[SAMP:[PURPLE:[&lt;] ]]
[SAMP:[PURPLE:[&gt;] ]]
[SAMP:[PURPLE:[*] ]]
[SAMP:[PURPLE:[#] ]]
[SAMP:[PURPLE:[_] ]]
[SAMP:[PURPLE:["] ]]
LI]

|H3 Description
|P1 To correctly render these signs you have to use the [B:escape syntax]

|P1 The syntax is simple: encapsulate the sign in these braces '[[]' '[]]'

|H3 Syntax
[CODE
[PURPLE:[[][[][]]]
==&gt; [[]
[PURPLE:[[][]][]]]
==&gt; []]
[PURPLE:[[][:][]]]
==&gt; [:]
[PURPLE:[[][|][]]]
==&gt; [|]
[PURPLE:[[][&lt;][]]]
==&gt; [&lt;]
[PURPLE:[[][&gt;][]]]
==&gt; [&gt;]
[PURPLE:[[][*][]]]
==&gt; [*]
[PURPLE:[[][#][]]]
==&gt; [#]
[PURPLE:[[][_][]]]
==&gt; [_]
[PURPLE:[[]["][]]]
==&gt; ["]

CODE]

|H3 Example

|H4 wiki
[CODE

[PURPLE:Index[[][[][]]2[[][]][]]]

to not display less and greater as the element
[PURPLE:[[]XML ]
[RED:&lt;wrong&gt;]
[PURPLE:[[][&lt;][]]right[[][&gt;][]]]
[PURPLE:XML[]]]

CODE]

|H4 result
[BQ
Index[[]2[]]
[XML
&lt;wrong&gt;
[&lt;]right[&gt;]
XML]
BQ]



|H2 [NAME:tables] Tables
|PR [URL:#top | TEXT: top]

|P1 Tables has been introduced following the usual syntax of the VLINE  [SAMP:[|]]
|P1 Use two VLINEs [SAMP:[|][|]] for a table head, and single VLINE [SAMP:[|]] for a table row

|H3 Keywords
[LI
[|]|
[|]
LI]
|H3 Syntax
[CODE
[|]| heading1 || heading2 // two VLINEs will render THEAD
[|]| heading3 || heading4
[|]  cell1    |  cell2    // single VLINE for a row
[|]  cell3    |  cell4
CODE]

|H3 Example

|H4 wiki
[CODE
[|]| id  || date     || name
[|]  123 |  1.2.2011 | myName
CODE]


|H4 result

|| id || date || name
|  123 |  1.2.2011 | myName


|PR [URL:#top | TEXT: top]

Enjoy the Wiki .NET Parser</Text>
    <HtmlText>&lt;h1&gt;
WIKI.NET &lt;a name="top" &gt;&lt;/a&gt;&lt;/h1&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="#simpleText" title="#simpleText" &gt; Simple Text&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#paragraph" title="#paragraph" &gt; Headers and Paragraphs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#lists" title="#lists" &gt; Lists&lt;/a&gt; &lt;span style="color:Green;" &gt;&lt;i&gt;(extended)&lt;/i&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#navigation" title="#navigation" &gt; Navigation&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color:Green;" &gt;&lt;i&gt;(fixed for long url)&lt;/i&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#image" title="#image" &gt; Image&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#decoration" title="#decoration" &gt; Decorations and Colors&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color:Green;" &gt;&lt;i&gt;(extended)&lt;/i&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#block" title="#block" &gt; Block&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#escaped" title="#escaped" &gt; Escaped character syntax&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#tables" title="#tables" &gt; Tables&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color:Green;" &gt;&lt;i&gt;(new)&lt;/i&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
Notes&lt;/h2&gt;
&lt;p class="p1" &gt;
This document is written in the &lt;b&gt;&lt;span style="color:Green;" &gt;Wiki .NET&lt;/span&gt;&lt;/b&gt; Syntax and converted with the &lt;b&gt;&lt;span style="color:Green;" &gt;Wiki .NET Parser&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&amp;nbsp;(and therefore could be taken as a proof of concept).&lt;/p&gt;
&lt;p class="p1" &gt;
&lt;b&gt;&lt;span style="color:Green;" &gt;WIKI.NET&lt;/span&gt;&lt;/b&gt; is based on the ANTLR3 for C#.NET. Very few rows of the lexer, grammar and AST Parser; future extensibility; easy maintainability; exceptional performance&lt;/p&gt;
&lt;p class="p1" &gt;
Syntax of the &lt;b&gt;&lt;span style="color:Green;" &gt;Wiki .NET&lt;/span&gt;&lt;/b&gt; is (from the highlighting point of view) mostly C# and XML oriented.&lt;/p&gt;
&lt;p class="p1" &gt;
In next paragraphs there is complete description of the syntax with examples. Syntax elements could be split into these categories:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Blocks (special formatting like XML)&lt;/li&gt;
&lt;li&gt;Inline Blocks (text)&lt;/li&gt;
&lt;li&gt;Decoration (styles, colors)&lt;/li&gt;
&lt;li&gt;Hyperlinks and images&lt;/li&gt;
&lt;/ul&gt;
&lt;p class="p1" &gt;
As in another languages there is a small set of the special leading characters used in &lt;b&gt;&lt;span style="color:Green;" &gt;Wiki .NET&lt;/span&gt;&lt;/b&gt; Syntax:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;[&lt;/span&gt;&lt;/samp&gt; (opening block)&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;]&lt;/span&gt;&lt;/samp&gt; (closing block)&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;|&lt;/span&gt;&lt;/samp&gt; (inline block; attribute separator)&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;:&lt;/span&gt;&lt;/samp&gt; (attribute value starts)&lt;/li&gt;
&lt;/ul&gt;
&lt;p class="p1" &gt;
These signs combined with keywords provides complete &lt;b&gt;&lt;span style="color:Green;" &gt;Wiki .NET&lt;/span&gt;&lt;/b&gt; playground for safe text publishing.&lt;/p&gt;
&lt;h2&gt;
&lt;a name="simpleText" &gt;&lt;/a&gt; Simple Text&lt;/h2&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
Keywords&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;samp&gt;&lt;i&gt;(there are NO keywords)&lt;/i&gt;&lt;/samp&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
Description&lt;/h3&gt;
&lt;p class="p1" &gt;
You can type text as it goes. It will be rendered as usual text without any formatting.&lt;/p&gt;
&lt;p class="p1" &gt;
The newlines (ENTER) will be rendered as a html specific new lines (instead of &amp;quot;\r\n&amp;quot; - &amp;quot;&amp;lt;br /&amp;gt;&amp;quot;).&lt;/p&gt;
&lt;p class="p1" &gt;
More Spaces (more then 1) will be all rendered (not skipped). &lt;i&gt; (Standard HTML browser will convert multi-space into single one)&lt;/i&gt;&lt;/p&gt;
&lt;p class="p1" &gt;
Empty lines are skipped. To append empty line to the output, place the White space on the line &lt;i&gt;(white space and press ENTER)&lt;/i&gt;&lt;/p&gt;
&lt;h3&gt;
Syntax&lt;/h3&gt;
&lt;code class="code" &gt;
There &lt;span class="spcl" &gt;is&lt;/span&gt; no special syntax, just type...&lt;br /&gt;
&lt;/code&gt;
&lt;h3&gt;
Example&lt;/h3&gt;
&lt;h4&gt;
wiki&lt;/h4&gt;
&lt;code class="code" &gt;
1&lt;span class="smbl" &gt;)&lt;/span&gt; Text with the&lt;br /&gt;
broken lines&lt;br /&gt;
2&lt;span class="smbl" &gt;)&lt;/span&gt; Text with&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;spaces&lt;br /&gt;
&lt;/code&gt;
&lt;h4&gt;
result&lt;/h4&gt;
&lt;blockquote class="bq" &gt;
1) Text with the&lt;br /&gt;
broken lines&lt;br /&gt;
2) Text with&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;spaces&lt;br /&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
&lt;a name="paragraph" &gt;&lt;/a&gt; Headers and Paragraph&lt;/h2&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;
Headers and Paragraphs has the syntax based on 3 parts&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Blue;" &gt;|&lt;/span&gt;&lt;/samp&gt; Leading vertical line at the beginning&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Blue;" &gt;H1&lt;/span&gt;&lt;/samp&gt; The name of the used header or paragraph&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Blue;" &gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;/samp&gt; One WHITE SPACE!&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
Keywords&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;|H1 .. |H6 &lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/samp&gt;(headers)&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;|P &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/samp&gt;(paragraph)&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;|P1 .. |P3 &lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/samp&gt;(paragraphs with different margins)&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;|PC &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/samp&gt;(center aligned paragraph)&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;|PR &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/samp&gt;(right aligned paragraph)&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;|CITE &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/samp&gt;(cite text (italic))&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;|BQ &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/samp&gt;(blockquote text with larger padding)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
Description&lt;/h3&gt;
&lt;p class="p1" &gt;
Headers and Paragraphs allows formatting based on &amp;#39;inline block&amp;#39; style.&lt;/p&gt;
&lt;p class="p1" &gt;
It means, that the text between the opening symbol (e.g. &amp;#39;&lt;samp&gt;&lt;span style="color:Purple;" &gt;|P &lt;/span&gt;&lt;/samp&gt;&amp;#39; and the end of line &lt;i&gt;(ENTER)&lt;/i&gt; is rendered as a paragraph &lt;span class="tag" &gt;&amp;lt;p&amp;gt;&lt;/span&gt;...&lt;span class="tag" &gt;&amp;lt;/p&amp;gt;&lt;/span&gt;)&lt;/p&gt;
&lt;h3&gt;
Syntax&lt;/h3&gt;
&lt;code class="code" &gt;
&lt;span style="color:Purple;" &gt;|H1 &lt;/span&gt; Header 1&lt;br /&gt;
- &lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt; &lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;h6&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;Header 1 &lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;h6&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
..&lt;br /&gt;
&lt;span style="color:Purple;" &gt;|H6 &lt;/span&gt; Header 6&lt;br /&gt;
- &lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt; &lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;h6&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;Header 6&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;h6&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color:Purple;" &gt;|P &lt;/span&gt; Usuall text...&lt;br /&gt;
- &lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt; &lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;p&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;Usuall text...&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;p&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/code&gt;
&lt;h3&gt;
Example&lt;/h3&gt;
&lt;h4&gt;
wiki&lt;/h4&gt;
&lt;code class="code" &gt;
&lt;span style="color:Purple;" &gt;|H3 &lt;/span&gt; Lorem ipsum&lt;br /&gt;
&lt;span style="color:Purple;" &gt;|P1 &lt;/span&gt; Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed dor eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.&lt;br /&gt;
&lt;span style="color:Purple;" &gt;|P2 &lt;/span&gt; Duis aute irure dolor &lt;span class="flw" &gt;in&lt;/span&gt; reprehenderit &lt;span class="flw" &gt;in&lt;/span&gt; voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt &lt;span class="flw" &gt;in&lt;/span&gt; culpa qui officia deserunt mollit anim id est laborum&lt;br /&gt;
&lt;span style="color:Purple;" &gt;|CITE &lt;/span&gt; Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.&lt;br /&gt;
&lt;span style="color:Purple;" &gt;|BQ &lt;/span&gt; Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.&lt;br /&gt;
&lt;span style="color:Purple;" &gt;|PR &lt;/span&gt; Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.&lt;br /&gt;
&lt;/code&gt;
&lt;h4&gt;
result&lt;/h4&gt;
&lt;blockquote class="bq" &gt;
&lt;h3&gt;
Lorem ipsum&lt;/h3&gt;
&lt;p class="p1" &gt;
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed dor eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.&lt;/p&gt;
&lt;p class="p2" &gt;
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum&lt;/p&gt;
&lt;cite class="cite" &gt;
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.&lt;/cite&gt;
&lt;blockquote class="bq" &gt;
Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.&lt;/blockquote&gt;
&lt;p class="pr" &gt;
Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
&lt;a name="lists" &gt;&lt;/a&gt; Lists&lt;/h2&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;p class="p1" &gt;
There are two types of lists. Wrapped and inline, for both &amp;#39;numbered&amp;#39; and &amp;#39;pointed&amp;#39; types.&lt;/p&gt;
&lt;h3&gt;
Keywords&lt;/h3&gt;
&lt;p&gt;Block syntax, uses starting and closing tags LI or/and NUM to wrap selected rows as list items.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;samp&gt;&amp;#39;[LI&amp;#39;&amp;nbsp;&amp;nbsp; &amp;#39;LI]&amp;#39;&amp;nbsp;&amp;nbsp;&lt;/samp&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&amp;#39;[NUM&amp;#39;&amp;nbsp;&amp;nbsp;&amp;#39;NUM]&amp;#39;&amp;nbsp;&amp;nbsp;&lt;/samp&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Inline syntax will render every row as a list item if starting with one of below statements (the space sign after asterix or hash is important)&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;samp&gt;&amp;#39;* &amp;#39;&lt;/samp&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&amp;#39;** &amp;#39;&lt;/samp&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&amp;#39;*** &amp;#39;&lt;/samp&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&amp;#39;# &amp;#39;&lt;/samp&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&amp;#39;## &amp;#39;&lt;/samp&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&amp;#39;### &amp;#39;&lt;/samp&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
Description&lt;/h3&gt;
&lt;p class="p1" &gt;
You can choose block or inline style. Block lists can be nested. Inline syntax must be correctly growing (cannot start with &amp;#39;** &amp;#39;)&lt;/p&gt;
&lt;h3&gt;
Block Syntax&lt;/h3&gt;
&lt;code class="code" &gt;
&lt;span style="color:Purple;" &gt;[LI &lt;/span&gt;&lt;br /&gt;
meals&lt;br /&gt;
colors&lt;br /&gt;
&lt;span style="color:Purple;" &gt;[NUM &lt;/span&gt;&lt;br /&gt;
blue&lt;br /&gt;
red&lt;br /&gt;
&lt;span style="color:Purple;" &gt; NUM]&lt;/span&gt;&lt;br /&gt;
&lt;span style="color:Purple;" &gt; LI]&lt;/span&gt;&lt;br /&gt;
&lt;/code&gt;
&lt;h3&gt;
Inline Syntax&lt;/h3&gt;
&lt;code class="code" &gt;
&lt;span style="color:Purple;" &gt;* &lt;/span&gt; meals&lt;br /&gt;
&lt;span style="color:Purple;" &gt;* &lt;/span&gt; colors&lt;br /&gt;
&lt;span style="color:Purple;" &gt;## &lt;/span&gt; blue&lt;br /&gt;
&lt;span style="color:Purple;" &gt;## &lt;/span&gt; read&lt;br /&gt;
&lt;/code&gt;
&lt;h3&gt;
Result for both&lt;/h3&gt;
&lt;code class="code" &gt;
&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;ul&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;li&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;meals&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;li&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;li&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;colors&lt;br /&gt;
&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;ol&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
 &lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;li&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;blue&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;li&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
 &lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;li&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;red&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;li&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;ol&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;li&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;ul&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/code&gt;
&lt;h3&gt;
Example&lt;/h3&gt;
&lt;h4&gt;
wiki&lt;/h4&gt;
&lt;code class="code" &gt;
 &lt;span class="cmmnt" &gt;// blocks
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&lt;span style="color:Purple;" &gt;[LI &lt;/span&gt;&lt;br /&gt;
Meals:&lt;br /&gt;
Supported colors are:&lt;br /&gt;
&lt;span style="color:Purple;" &gt;[NUM &lt;/span&gt;&lt;br /&gt;
blue&lt;br /&gt;
red&lt;br /&gt;
green&lt;br /&gt;
&lt;span style="color:Purple;" &gt;NUM]&lt;/span&gt;&lt;br /&gt;
&lt;span style="color:Purple;" &gt; LI]&lt;/span&gt;&lt;br /&gt;
 &lt;span class="cmmnt" &gt;// inlines
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;* Meals:&lt;br /&gt;
* Supported colors are:&lt;br /&gt;
## blue&lt;br /&gt;
## red&lt;br /&gt;
## green&lt;br /&gt;
&lt;/code&gt;
&lt;h4&gt;
result&lt;/h4&gt;
&lt;blockquote class="bq" &gt;
 // blocks
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Meals:&lt;/li&gt;
&lt;li&gt;Supported colors are:&lt;ol&gt;
&lt;li&gt;blue&lt;/li&gt;
&lt;li&gt;red&lt;/li&gt;
&lt;li&gt;green &lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;
 // inlines
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Meals:&lt;/li&gt;
&lt;li&gt;Supported colors are:&lt;ol&gt;
&lt;li&gt;blue&lt;/li&gt;
&lt;li&gt;red&lt;/li&gt;
&lt;li&gt;green&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
&lt;a name="navigation" &gt;&lt;/a&gt; Navigation&lt;/h2&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
Keywords&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;URL&lt;/span&gt;&lt;/samp&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;URL | TEXT&lt;/span&gt;&lt;/samp&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;NAME&lt;/span&gt;&lt;/samp&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
Description&lt;/h3&gt;
&lt;p class="p1" &gt;
There are two keywords: &lt;samp&gt;URL&lt;/samp&gt; and &lt;samp&gt;NAME&lt;/samp&gt; for creating the hyperlinks.&lt;/p&gt;
&lt;p class="p1" &gt;
The first &lt;i&gt;(&lt;samp&gt;URL&lt;/samp&gt;)&lt;/i&gt; will result in the hyperlink with the &lt;var&gt;href&lt;/var&gt; attribute (where to navigate). There are few different ways how to change the text of the hyperlink, if the &lt;var&gt;url&lt;/var&gt; itself is not suitable (e.g. &lt;dfn&gt;&lt;span class="tag" &gt;&amp;lt;a href=&amp;quot;target&amp;quot;&amp;gt;&lt;/span&gt;target&lt;span class="tag" &gt;&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;/dfn&gt; to &lt;dfn&gt;&lt;span class="tag" &gt;&amp;lt;a href=&amp;quot;target&amp;quot;&amp;gt;&lt;/span&gt;my TEXT&lt;span class="tag" &gt;&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;/dfn&gt;)&lt;/p&gt;
&lt;p class="p1" &gt;
The second will create the anchor&amp;nbsp;&amp;nbsp;&lt;i&gt;(&lt;samp&gt;NAME&lt;/samp&gt;)&lt;/i&gt; to which could be page scrolled &lt;i&gt;(e.g. the &amp;#39;top&amp;#39; hyperlinks navigating to the top of the page)&lt;/i&gt;&lt;/p&gt;
&lt;h3&gt;
Syntax URL&lt;/h3&gt;
&lt;code class="code" &gt;
&lt;span style="color:Purple;" &gt;[URL:index.htm#top&lt;/span&gt;] &lt;span class="cmmnt" &gt;// only url
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt; &lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;a &lt;span class="base" &gt;ref&lt;/span&gt;&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="qtd" &gt;&amp;quot;index.htm#top&amp;quot;&lt;/span&gt;&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;index.htm#top&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;a&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color:Purple;" &gt;[URL: click here | index.htm#top&lt;/span&gt;]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="cmmnt" &gt;// short text first
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt; &lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;a &lt;span class="base" &gt;ref&lt;/span&gt;&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="qtd" &gt;&amp;quot;index.htm#top&amp;quot;&lt;/span&gt; &lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;click here&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;a&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt; &lt;span class="cmmnt" &gt;// then vline &amp;#39;|&amp;#39; and url
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="cmmnt" &gt;// OR
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&lt;span style="color:Purple;" &gt;[URL:&amp;nbsp;&amp;nbsp;index.htm#top |TEXT: click here&lt;/span&gt;]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="cmmnt" &gt;// first url
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt; &lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;a &lt;span class="base" &gt;ref&lt;/span&gt;&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="qtd" &gt;&amp;quot;index.htm#top&amp;quot;&lt;/span&gt; &lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;click here&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;a&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt; &lt;span class="cmmnt" &gt;// then attr &amp;#39;|TEXT:&amp;#39; and text
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color:Purple;" &gt;[URL: &amp;quot;index.htm#top&amp;quot; |TEXT: click here&lt;/span&gt;]&amp;nbsp;&amp;nbsp; &lt;span class="cmmnt" &gt;// quoted url (if too long and complicated url)
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt; &lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;a &lt;span class="base" &gt;ref&lt;/span&gt;&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="qtd" &gt;&amp;quot;index.htm#top&amp;quot;&lt;/span&gt; &lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;click here&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;a&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt; &lt;span class="cmmnt" &gt;// |TEXT: next with an attr &amp;#39;TEXT:&amp;#39;
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&lt;br /&gt;
&lt;/code&gt;
&lt;h3&gt;
Syntax NAME&lt;/h3&gt;
&lt;code class="code" &gt;
&lt;span style="color:Purple;" &gt;[NAME:top&lt;/span&gt;]&lt;br /&gt;
- &lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;a name&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="qtd" &gt;&amp;quot;top&amp;quot;&lt;/span&gt;&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;a&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/code&gt;
&lt;h3&gt;
Example&lt;/h3&gt;
&lt;h4&gt;
Wiki&lt;/h4&gt;
&lt;code class="code" &gt;
&lt;span style="color:Purple;" &gt;[URL:#top&lt;/span&gt;]&amp;nbsp;&amp;nbsp; - only url&lt;br /&gt;
&lt;span style="color:Purple;" &gt;[URL:TOP | #top&lt;/span&gt;]&amp;nbsp;&amp;nbsp;- text first&lt;br /&gt;
&lt;span style="color:Purple;" &gt;[URL: #top&amp;nbsp;&amp;nbsp;|TEXT: TOP&lt;/span&gt;] - TEXT: attribute&lt;br /&gt;
&lt;span style="color:Purple;" &gt;[URL:&amp;quot;#top&amp;quot; |TEXT: TOP&lt;/span&gt;] - quoted url&lt;br /&gt;
&lt;/code&gt;
&lt;h4&gt;
Result&lt;/h4&gt;
&lt;blockquote class="bq" &gt;
&lt;a href="#top" title="#top" &gt;#top&lt;/a&gt;&amp;nbsp;&amp;nbsp;- only url&lt;br /&gt;
&lt;a href="#top" title="#top" &gt;TOP&lt;/a&gt; - short text first&lt;br /&gt;
&lt;a href="#top" title="#top" &gt;TOP&lt;/a&gt;&amp;nbsp;&amp;nbsp;- TEXT: attribute&lt;br /&gt;
&lt;a href="#top" title="#top" &gt;TOP&lt;/a&gt;&amp;nbsp;&amp;nbsp;- quoted url&lt;br /&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
&lt;a name="image" &gt;&lt;/a&gt; Image&lt;/h2&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
Keywords&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;IMG&lt;/span&gt;&lt;/samp&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;HEIGHT&lt;/span&gt;&lt;/samp&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;WIDTH&lt;/span&gt;&lt;/samp&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;FLOAT&lt;/span&gt;&lt;/samp&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
Description&lt;/h3&gt;
&lt;p class="p1" &gt;
&lt;samp&gt;&lt;span style="color:Purple;" &gt;IMG&lt;/span&gt;&lt;/samp&gt; element allows you to insert the image into to the page.&lt;/p&gt;
&lt;p class="p1" &gt;
The URL for image should be relative, for instance &amp;#39;i/cs.png&amp;#39;&lt;/p&gt;
&lt;p class="p1" &gt;
There is an issue with the virtual directories for applications. E.g. instead of &lt;i&gt;http://mydomain/&lt;/i&gt; there is &lt;i&gt;http://mydomain/myvirtualdir/&lt;/i&gt;. In these situations there is a background call which will change the IMG src attribute from&amp;nbsp;&amp;nbsp;&lt;del&gt;&lt;span style="color:Red;" &gt;&amp;#39;i/cs.png&amp;#39;&lt;/span&gt;&lt;/del&gt; to&amp;nbsp;&amp;nbsp;&lt;span style="color:Green;" &gt;&amp;#39;myvirtualdir/i/cs.png&amp;#39;&lt;/span&gt; and the image will be correctly displayed.&lt;/p&gt;
&lt;h3&gt;
Syntax&lt;/h3&gt;
&lt;code class="code" &gt;
&lt;span style="color:Purple;" &gt;[IMG:i/cs.png]&lt;/span&gt;&lt;br /&gt;
&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt; &lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;img src&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="qtd" &gt;&amp;quot;i/cs.png&amp;quot;&lt;/span&gt; &lt;span class="smbl" &gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color:Purple;" &gt;[IMG:i/cs.png |HEIGHT:100px|WIDTH:80px]&lt;/span&gt;&lt;br /&gt;
&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt; &lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;img src&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="qtd" &gt;&amp;quot;i/cs.png&amp;quot;&lt;/span&gt; style&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="qtd" &gt;&amp;quot;height:100px;width:80px;&amp;quot;&lt;/span&gt; &lt;span class="smbl" &gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color:Purple;" &gt;[IMG:i/cs.png |FLOAT:right]&lt;/span&gt;&lt;br /&gt;
&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt; &lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;img src&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="qtd" &gt;&amp;quot;i/cs.png&amp;quot;&lt;/span&gt; style&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="qtd" &gt;&amp;quot;float:right;&amp;quot;&lt;/span&gt; &lt;span class="smbl" &gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/code&gt;
&lt;h3&gt;
Example&lt;/h3&gt;
&lt;h4&gt;
wiki&lt;/h4&gt;
&lt;code class="code" &gt;
&lt;span style="color:Purple;" &gt;|P1 &lt;/span&gt; Lorem ipsum dolor &lt;span style="color:Purple;" &gt;[IMG:i/cs.png]&lt;/span&gt;&amp;nbsp;&amp;nbsp;sit amet, consectetur adipisicing elit, sed dor eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.&lt;br /&gt;
&lt;span style="color:Purple;" &gt;|P2 &lt;/span&gt; Duis aute irure dolor &lt;span class="flw" &gt;in&lt;/span&gt; reprehenderit &lt;span class="flw" &gt;in&lt;/span&gt; voluptate velit esse cillum dolore eu fugiat nulla pariatur. &lt;span style="color:Purple;" &gt;[IMG:i/cs.png|HEIGHT:100px| WIDTH:80px]&lt;/span&gt;&amp;nbsp;&amp;nbsp;Excepteur sint occaecat cupidatat non proident, sunt &lt;span class="flw" &gt;in&lt;/span&gt; culpa qui officia deserunt mollit anim id est laborum&lt;br /&gt;
&lt;span style="color:Purple;" &gt;|P3 &lt;/span&gt; Sed &lt;span style="color:Purple;" &gt;[IMG:i/cs.png|FLOAT:right]&lt;/span&gt;&amp;nbsp;&amp;nbsp;ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.&lt;br /&gt;
&lt;/code&gt;
&lt;h4&gt;
result&lt;/h4&gt;
&lt;blockquote class="bq" &gt;
&lt;p class="p1" &gt;
Lorem ipsum dolor &lt;img src="/i/cs.png" alt="/i/cs.png" style="" /&gt;&amp;nbsp;&amp;nbsp;sit amet, consectetur adipisicing elit, sed dor eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.&lt;/p&gt;
&lt;p class="p2" &gt;
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. &lt;img src="/i/cs.png" alt="/i/cs.png" style="height: 100px;width: 80px;" /&gt;&amp;nbsp;&amp;nbsp;Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum&lt;/p&gt;
&lt;p class="p3" &gt;
Sed &lt;img src="/i/cs.png" alt="/i/cs.png" style="float: right;" /&gt; ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
&lt;a name="decoration" &gt;&lt;/a&gt; Decorations and Colors&lt;/h2&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
Keywords&lt;/h3&gt;
&lt;p&gt;&lt;b&gt; Special bold and italic:&lt;/b&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;samp&gt; *bold text*&amp;nbsp;&amp;nbsp; &lt;/samp&gt;&lt;b&gt;bold text&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt; _italic text_ &lt;/samp&gt; &lt;i&gt;italic text&lt;/i&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;b&gt; Decorations:&lt;/b&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;B&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/samp&gt;&lt;b&gt;bold&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;I&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/samp&gt;&lt;i&gt;italic&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;U&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/samp&gt;&lt;ins&gt;underline&lt;/ins&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;S&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/samp&gt;&lt;del&gt;striked&lt;/del&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;V&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/samp&gt;&lt;var&gt;variable&lt;/var&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;SAMP&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/samp&gt;&lt;samp&gt;sample&lt;/samp&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;BIG&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;/samp&gt;&lt;big&gt;big&lt;/big&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;SMALL&lt;/span&gt; &lt;/samp&gt;&lt;small&gt;small&lt;/small&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;SUP&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;/samp&gt;sup &lt;sup&gt;*sup&lt;/sup&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;SUB&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;/samp&gt;sub &lt;sub&gt;*sub&lt;/sub&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;b&gt; Colors:&lt;/b&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;BLUE&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;/samp&gt;&lt;span style="color:Blue;" &gt;blue&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;RED&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/samp&gt;&lt;span style="color:Red;" &gt;red&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;GREEN&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/samp&gt;&lt;span style="color:Green;" &gt;green&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;OLIVE&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/samp&gt;&lt;span style="color:Olive;" &gt;olive&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;LIME&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;/samp&gt;&lt;span style="color:Lime;" &gt;lime&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;PURPLE&lt;/span&gt; &lt;/samp&gt;&lt;span style="color:Purple;" &gt;purple&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;YELLOW&lt;/span&gt; &lt;/samp&gt;&lt;span style="color:Yellow;" &gt;yellow&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;MAROON&lt;/span&gt; &lt;/samp&gt;&lt;span style="color:Maroon;" &gt;maroon&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;SILVER&lt;/span&gt; &lt;/samp&gt;&lt;span style="color:Silver;" &gt;silver&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;ORANGE&lt;/span&gt; &lt;/samp&gt;&lt;span style="color:Orange;" &gt;orange&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;NAVY&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;/samp&gt;&lt;span style="color:Navy;" &gt;navy&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;PINK&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;/samp&gt;&lt;span style="color:Pink;" &gt;pink&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
Description&lt;/h3&gt;
&lt;p class="p1" &gt;
Decoration styles and colors are &amp;#39;inline&amp;#39; elements. This means that these elements cannot contain new lines!&lt;/p&gt;
&lt;p class="p1" &gt;
You can use them almost anywhere and if needed they can be even nested (e.g. bold and blue)&lt;/p&gt;
&lt;h3&gt;
Syntax&lt;/h3&gt;
&lt;code class="code" &gt;
&lt;span class="cmmnt" &gt;// bold and italic inside some row
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;.. not bold *now bold until here* not bold ..&lt;br /&gt;
&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt; .. not bold &lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;b&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;now bold until here&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;b&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt; not bold ..&lt;br /&gt;
.. not italic _now italic until here_ not italic ..&lt;br /&gt;
&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt; .. not italic &lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;i&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;now italic until here&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;i&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt; not italic ..&lt;br /&gt;
&lt;span class="cmmnt" &gt;// bold and italic
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&lt;span style="color:Purple;" &gt;[B:bold]&lt;/span&gt;&lt;br /&gt;
&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt; &lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;b&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;bold&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;b&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color:Purple;" &gt;[I:italic]&lt;/span&gt;&lt;br /&gt;
&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt; &lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;i&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;italic&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;i&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="cmmnt" &gt;// COLOR example: blue and purple
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&lt;span style="color:Purple;" &gt;[BLUE:blue]&lt;/span&gt;&lt;br /&gt;
- &lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt; &lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;span style&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="qtd" &gt;&amp;quot;color:blue;&amp;quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;blue&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;span&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color:Purple;" &gt;[PURPLE:purple]&lt;/span&gt;&lt;br /&gt;
- &lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt; &lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;span style&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="qtd" &gt;&amp;quot;color:purple;&amp;quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;purple&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;span&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/code&gt;
&lt;h3&gt;
Example&lt;/h3&gt;
&lt;h4&gt;
wiki&lt;/h4&gt;
&lt;code class="code" &gt;
&lt;span style="color:Purple;" &gt;|CITE&lt;/span&gt; This text could be partially &lt;span style="color:Purple;" &gt;[B:&lt;/span&gt;bold end even &lt;span style="color:Purple;" &gt;[ORANGE:&lt;/span&gt;orange&lt;span style="color:Purple;" &gt;]]&lt;/span&gt;. And that all inside the big &lt;span style="color:Purple;" &gt;[BIG:&lt;/span&gt;CITE&lt;span style="color:Purple;" &gt;]&lt;/span&gt; element.&lt;br /&gt;
&lt;/code&gt;
&lt;h4&gt;
result&lt;/h4&gt;
&lt;blockquote class="bq" &gt;
&lt;cite class="cite" &gt;
This text could be partially &lt;b&gt;bold end even &lt;span style="color:Orange;" &gt;orange&lt;/span&gt;&lt;/b&gt;. And that all inside the &lt;big&gt;CITE&lt;/big&gt; element.&lt;/cite&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
&lt;a name="block" &gt;&lt;/a&gt; Block&lt;/h2&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;p class="p1" &gt;
There are 3 special block elements for specific text rendering: CODE, XML, HTML. There is also the BlockQuote element: BQ.&lt;/p&gt;
&lt;h3&gt;
Keywords&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;CODE &lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/samp&gt;&lt;i&gt;C# syntax support&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;XML &lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;/samp&gt;&lt;i&gt;xml syntax support&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;HTML &lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/samp&gt;&lt;i&gt;html specific syntax support&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;BQ &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/samp&gt;&lt;i&gt;support for multi-line blockquote&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;PRE &lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;/samp&gt;&lt;i&gt;renders PRE element&lt;/i&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
Description&lt;/h3&gt;
&lt;p class="p1" &gt;
These block elementshas the special syntax which has OPENING and CLOSING tags. The text placed between the CODE, XML, HTML marks is rendered with special syntax support.&lt;/p&gt;
&lt;p class="p1" &gt;
Usage of these element is extremely simple: just copy your code, and place it between &lt;span style="color:Purple;" &gt;[CODE CODE]&lt;/span&gt; elements. That&amp;#39;s all&lt;/p&gt;
&lt;h3&gt;
Syntax&lt;/h3&gt;
&lt;code class="code" &gt;
&lt;span style="color:Purple;" &gt;[CODE &lt;/span&gt;&lt;br /&gt;
&lt;span class="base" &gt;public&lt;/span&gt; &lt;span class="base" &gt;interface&lt;/span&gt; IModel &lt;span class="smbl" &gt;{&lt;/span&gt;&lt;span class="smbl" &gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="color:Purple;" &gt;CODE]&lt;/span&gt;&lt;br /&gt;
- &lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt; &lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;code&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;span &lt;span class="base" &gt;class&lt;/span&gt;&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="qtd" &gt;&amp;quot;base&amp;quot;&lt;/span&gt; &lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base" &gt;public&lt;/span&gt;&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;span&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;span &lt;span class="base" &gt;class&lt;/span&gt;&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="qtd" &gt;&amp;quot;base&amp;quot;&lt;/span&gt; &lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base" &gt;interface&lt;/span&gt;&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;span&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
IModel&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;br &lt;span class="smbl" &gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;span &lt;span class="base" &gt;class&lt;/span&gt;&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="qtd" &gt;&amp;quot;smbl&amp;quot;&lt;/span&gt; &lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;span&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;br &lt;span class="smbl" &gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;span &lt;span class="base" &gt;class&lt;/span&gt;&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="qtd" &gt;&amp;quot;cmmnt&amp;quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;span class="cmmnt" &gt;// TODO&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;span &lt;span class="base" &gt;class&lt;/span&gt;&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="qtd" &gt;&amp;quot;smbl&amp;quot;&lt;/span&gt; &lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="smbl" &gt;}&lt;/span&gt;&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;span&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;br &lt;span class="smbl" &gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;code&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/code&gt;
&lt;h3&gt;
Example&lt;/h3&gt;
&lt;h4&gt;
wiki&lt;/h4&gt;
&lt;code class="code" &gt;
&lt;span style="color:Purple;" &gt;|H5 &lt;/span&gt; CODE&lt;br /&gt;
&lt;span style="color:Purple;" &gt;[CODE &lt;/span&gt;&lt;br /&gt;
&lt;span class="base" &gt;public&lt;/span&gt; &lt;span class="base" &gt;interface&lt;/span&gt; IModel&lt;br /&gt;
&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span class="cmmnt" &gt;// TODO
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&lt;span class="smbl" &gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="color:Purple;" &gt;CODE]&lt;/span&gt;&lt;br /&gt;
&lt;span style="color:Purple;" &gt;|H5&lt;/span&gt; XML&lt;br /&gt;
&lt;span style="color:Purple;" &gt;[XML &lt;/span&gt;&lt;br /&gt;
&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;project&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;settings&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;mode value&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="qtd" &gt;&amp;quot;Leveled&amp;quot;&lt;/span&gt;
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="qtd" &gt;&amp;quot;Fluent&amp;quot;&lt;/span&gt; &lt;span class="smbl" &gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;readability name&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="qtd" &gt;&amp;quot;Inner&amp;quot;&lt;/span&gt; &lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="cmmnt" &gt;&amp;lt;!-- TODO --&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;... extended &lt;span class="flw" &gt;in&lt;/span&gt; the next phase ...&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;readability&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;settings&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;project&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color:Purple;" &gt;XML] &lt;/span&gt;&lt;br /&gt;
&lt;span style="color:Purple;" &gt;|H5&lt;/span&gt; HTML&lt;br /&gt;
&lt;span style="color:Purple;" &gt;[HTML &lt;/span&gt;&lt;br /&gt;
&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;html xmlns&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="qtd" &gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&lt;/span&gt; &lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;head&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;title&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;title&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;head&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;body&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;a href&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="qtd" &gt;&amp;quot;Index.htm&amp;quot;&lt;/span&gt; &lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Default&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;a&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;body&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;html&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color:Purple;" &gt;HTML] &lt;/span&gt;&lt;br /&gt;
&lt;/code&gt;
&lt;h4&gt;
result&lt;/h4&gt;
&lt;blockquote class="bq" &gt;
&lt;h5&gt;
CODE&lt;/h5&gt;
&lt;code class="code" &gt;
&lt;span class="base" &gt;public&lt;/span&gt; &lt;span class="base" &gt;interface&lt;/span&gt; IModel&lt;br /&gt;
&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;span class="cmmnt" &gt;// TODO
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&lt;span class="smbl" &gt;}&lt;/span&gt;&lt;br /&gt;
&lt;/code&gt;
&lt;h5&gt;
XML&lt;/h5&gt;
&lt;code class="xml" &gt;
&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;project&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;settings&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;mode value&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="qtd" &gt;&amp;quot;Leveled&amp;quot;&lt;/span&gt;
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;type&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="qtd" &gt;&amp;quot;Fluent&amp;quot;&lt;/span&gt; &lt;span class="smbl" &gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;readability name&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="qtd" &gt;&amp;quot;Inner&amp;quot;&lt;/span&gt; &lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="cmmnt" &gt;&amp;lt;!-- TODO --&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;extended in the next phase&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;readability&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;settings&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;project&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/code&gt;
&lt;h5&gt;
 HTML&lt;/h5&gt;
&lt;code class="html" &gt;
&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;html xmlns&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="qtd" &gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&lt;/span&gt; &lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;head&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;&lt;span class="html" &gt;title&lt;/span&gt;&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;&lt;span class="html" &gt;title&lt;/span&gt;&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;head&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;body&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;a &lt;span class="html" &gt;href&lt;/span&gt;&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="qtd" &gt;&amp;quot;Index.htm&amp;quot;&lt;/span&gt; &lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Default&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;a&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;body&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;/&lt;/span&gt;html&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/code&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
&lt;a name="escaped" &gt;&lt;/a&gt; Escaped character syntax&lt;/h2&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;p class="p1" &gt;
There are some special characters used for this wiki markup. They are &lt;b&gt;leading symbols&lt;/b&gt; and therefore cannot be used directly in the text&lt;/p&gt;
&lt;p class="p1" &gt;
If they are used directly (without escaping) they could result in unwanted streams; or even break the whole page.&lt;/p&gt;
&lt;h3&gt;
Keywords&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;[ &lt;/span&gt;&lt;/samp&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;] &lt;/span&gt;&lt;/samp&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;| &lt;/span&gt;&lt;/samp&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;: &lt;/span&gt;&lt;/samp&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;&amp;lt; &lt;/span&gt;&lt;/samp&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;&amp;gt; &lt;/span&gt;&lt;/samp&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;* &lt;/span&gt;&lt;/samp&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;# &lt;/span&gt;&lt;/samp&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;_ &lt;/span&gt;&lt;/samp&gt;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;&lt;span style="color:Purple;" &gt;&amp;quot; &lt;/span&gt;&lt;/samp&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
Description&lt;/h3&gt;
&lt;p class="p1" &gt;
To correctly render these signs you have to use the &lt;b&gt;escape syntax&lt;/b&gt;&lt;/p&gt;
&lt;p class="p1" &gt;
The syntax is simple: encapsulate the sign in these braces &amp;#39;[&amp;#39; &amp;#39;]&amp;#39;&lt;/p&gt;
&lt;h3&gt;
Syntax&lt;/h3&gt;
&lt;code class="code" &gt;
&lt;span style="color:Purple;" &gt;[[]&lt;/span&gt;&lt;br /&gt;
&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt; [&lt;br /&gt;
&lt;span style="color:Purple;" &gt;[]]&lt;/span&gt;&lt;br /&gt;
&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt; ]&lt;br /&gt;
&lt;span style="color:Purple;" &gt;[:]&lt;/span&gt;&lt;br /&gt;
&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt; :&lt;br /&gt;
&lt;span style="color:Purple;" &gt;[|]&lt;/span&gt;&lt;br /&gt;
&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt; |&lt;br /&gt;
&lt;span style="color:Purple;" &gt;[&amp;lt;]&lt;/span&gt;&lt;br /&gt;
&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt; &amp;lt;&lt;br /&gt;
&lt;span style="color:Purple;" &gt;[&amp;gt;]&lt;/span&gt;&lt;br /&gt;
&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt; &amp;gt;&lt;br /&gt;
&lt;span style="color:Purple;" &gt;[*]&lt;/span&gt;&lt;br /&gt;
&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt; *&lt;br /&gt;
&lt;span style="color:Purple;" &gt;[#]&lt;/span&gt;&lt;br /&gt;
&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt; #&lt;br /&gt;
&lt;span style="color:Purple;" &gt;[_]&lt;/span&gt;&lt;br /&gt;
&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt; _&lt;br /&gt;
&lt;span style="color:Purple;" &gt;[&amp;quot;]&lt;/span&gt;&lt;br /&gt;
&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;=&lt;/span&gt;&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt; &amp;quot;&lt;br /&gt;
&lt;/code&gt;
&lt;h3&gt;
Example&lt;/h3&gt;
&lt;h4&gt;
wiki&lt;/h4&gt;
&lt;code class="code" &gt;
&lt;span style="color:Purple;" &gt;Index[[]2[]]&lt;/span&gt;&lt;br /&gt;
to not display less and greater &lt;span class="spcl" &gt;as&lt;/span&gt; the element&lt;br /&gt;
&lt;span style="color:Purple;" &gt;[XML &lt;/span&gt;&lt;br /&gt;
&lt;span style="color:Red;" &gt;&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;wrong&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color:Purple;" &gt;[&amp;lt;]right[&amp;gt;]&lt;/span&gt;&lt;br /&gt;
&lt;span style="color:Purple;" &gt;XML]&lt;/span&gt;&lt;br /&gt;
&lt;/code&gt;
&lt;h4&gt;
result&lt;/h4&gt;
&lt;blockquote class="bq" &gt;
Index[2]&lt;br /&gt;
&lt;code class="xml" &gt;
&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;wrong&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;lt;right&amp;gt;&lt;br /&gt;
&lt;/code&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
&lt;a name="tables" &gt;&lt;/a&gt; Tables&lt;/h2&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;p class="p1" &gt;
Tables has been introduced following the usual syntax of the VLINE&amp;nbsp;&amp;nbsp;&lt;samp&gt;|&lt;/samp&gt;&lt;/p&gt;
&lt;p class="p1" &gt;
Use two VLINEs &lt;samp&gt;||&lt;/samp&gt; for a table head, and single VLINE &lt;samp&gt;|&lt;/samp&gt; for a table row&lt;/p&gt;
&lt;h3&gt;
Keywords&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;||&lt;/li&gt;
&lt;li&gt;|&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
Syntax&lt;/h3&gt;
&lt;code class="code" &gt;
|| heading1 || heading2 &lt;span class="cmmnt" &gt;// two VLINEs will render THEAD
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;|| heading3 || heading4&lt;br /&gt;
|&amp;nbsp;&amp;nbsp;cell1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|&amp;nbsp;&amp;nbsp;cell2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="cmmnt" &gt;// single VLINE for a row
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;|&amp;nbsp;&amp;nbsp;cell3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|&amp;nbsp;&amp;nbsp;cell4&lt;br /&gt;
&lt;/code&gt;
&lt;h3&gt;
Example&lt;/h3&gt;
&lt;h4&gt;
wiki&lt;/h4&gt;
&lt;code class="code" &gt;
|| id&amp;nbsp;&amp;nbsp;|| date&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; || name&lt;br /&gt;
|&amp;nbsp;&amp;nbsp;123 |&amp;nbsp;&amp;nbsp;1.2.2011 | myName&lt;br /&gt;
&lt;/code&gt;
&lt;h4&gt;
result&lt;/h4&gt;
&lt;table&gt;
&lt;thead&gt;&lt;tr&gt;&lt;td&gt;id &lt;/td&gt;&lt;td&gt;date &lt;/td&gt;&lt;td&gt;name&lt;/td&gt;&lt;/tr&gt;&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt; 123 &lt;/td&gt;&lt;td&gt; 1.2.2011 &lt;/td&gt;&lt;td&gt;myName&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Enjoy the Wiki .NET Parser&lt;/p&gt;
</HtmlText>
  </Article>
  <Article ID="4" CreationDate="2011-05-25T12:34:56.7" LastUpdateDate="2013-05-02T16:37:16.5815266+02:00" ReleaseDate="2010-08-25T12:34:56.7" IsVisible="false" ShowComment="true" Code="Home" Title="Home" Description="Home" ArticleCategoryId="1" ArticleGroupId="1">
    <Text>Welcome aboard</Text>
    <HtmlText>&lt;p&gt;Welcome aboard&lt;/p&gt;
</HtmlText>
  </Article>
  <Article ID="5" CreationDate="2013-04-24T15:30:26.6602094+02:00" LastUpdateDate="2013-05-03T07:58:08.9209887+02:00" ReleaseDate="2013-04-24T15:56:06.1062094+02:00" IsVisible="true" ShowComment="true" Code="WebAPIOverview" Title="The Web API concept for the Application tier" Description="The Web API concept. What does mean API? Why web? Application Server and its interfaces (API) in more details&#xD;&#xA;" ArticleCategoryId="2" ArticleGroupId="2">
    <Text>|H1 Web API [NAME:top]

[NUM
[URL:#basics|TEXT: Web API Principles]
[URL:#get|TEXT: Get by ID]
[URL:#create|TEXT: Create new]
[URL:#amend|TEXT: Amend existing ]
[URL:#delete|TEXT: Delete ]
[URL:#meta|TEXT: MetaData ]
[URL:#query|TEXT: Querying, OData protocol support]
[LI
[URL:#od_top|TEXT: $top]
[URL:#od_skip|TEXT: $skip]
[URL:#od_inlinecount|TEXT: $inlinecount]
[URL:#od_orderby|TEXT: $orderby]
[URL:#od_select|TEXT: $select]
[URL:#od_expand|TEXT: $expand]
[URL:#od_filter|TEXT: $filter]
LI]
NUM]


|H2 [NAME:basics] Web API Principles
|PR [URL:#top     | TEXT: top]

Microsoft Official web-site: [URL:http://www.asp.net/web-api/].

|H3 What is Web API?

The Web API short and MS official description (see more [URL:here|http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api])

[BQ
ASP.NET Web API is a framework that makes it easy to build HTTP services that reach a broad range of clients, including browsers and mobile devices. ASP.NET Web API is an ideal platform for building RESTful applications on the .NET Framework.
BQ]

The Web API principles are built on top of the HTTP protocol. The most important features to be mentioned here are:

* URL - the unique address (e.g. [SAMP:http://server/ems/api/employee/1])
* HTTP METHOD - the switch giving the URL meaning. e.g. GET to receive data PUT to update existing
* BODY - the content of the request/response. A place where are enclosed data 1) requested or 2) sent from a client

Let's put that all together and we can have this overview:

|| Action 	                || HTTP method 	    || Relative URI
| Get a list of all products 	| [GREEN:GET]       | /api/employee
| Get a product by ID 	        | [GREEN:GET] 	    | /api/employee/id
| Querying with OData 	        | [GREEN:GET]       | /api/employee? $filter=startswith(FirstName, 'A') &amp;$orderby=LastName desc &amp;$select=ID, LastName, FirstName
| Create a new product 	        | [RED:POST] 	    | /api/employee
| Update a product 	        | [RED:PUT] 	    | /api/employee/id
| Delete a product 	        | [RED:DELETE]      | /api/employee/id


|H4 What is beyond the Web API?

The Web API [I:(Application interface)] is a [B:server application]. It sits on a Windows Server 2008+ (or even more in a web-farm of servers -to improve performance) as a web site application, managed by IIS (see: [URL: Internet Information Service | http://en.wikipedia.org/wiki/Internet_Information_Services])

The Web Server is responding to requests [I:(get data, change existing, post new records)] the standard way, via HTTP Protocol.

|H4 What is the benefit of the Web API? 

The most important thing is, that Web API principle is a way how to separate the fundamental responsibilities. 
# Business rules engine (server) vs. 
# Client UI(user interface) application. 

All data handling [I:(loading from DB, ActiveDirectory, xml)] applying business rules, evaluating security is done beyond the Web API. Consumers do not care how these processes are working. They just send requests. If the request is correct, response is returned. If there are any issues (wrong request, wrong data...) consumers are provided with error messages.

This mostly means that any changes on the server side (Web API) should not affect the Client UI. And also there could be more consumers, different client application consuming the API. Let's mention the web browser application, WPF smart application or mobile lightweight application.


|H4 How does the Web API work?

In the next paragraphs, we will see the detailed description of our implementation and design of the Application interface. We will see how to 1) Read data and 2) Write them back.






|H2 [NAME:get] Get by ID
|PR [URL:#top     | TEXT: top]

The read operations (as Get by ID) are responding to the questions represented by URL. Let's assume there are two employees in the system:

|| EmployeeID || FirstName || LastName
| ...     | ...     | ...
| 1234    | Radim   | Köhler
| 1235    | John    | Walker

The Get by ID action is here to allow client application to get detailed information about any Employee [I:(if security and other rules are met)] by passing the Employee [B:ID]. To do that we have to assemble URL like this:


Method [SAMP: GET]
[SAMP:http://server/ems/api/employee/1234]

where the meaning of each part of the URL is:
* [SAMP:server] - is the name of the production server
* [SAMP:ems] - the name of application
* [SAMP:api] - the switch informing the server that API part of application could be used
* [SAMP:employee] - the name of the requested object
* [SAMP:1234] - the [B:ID] of requested object

When the Client application will execute such request, it will be provided with a result in a JSON format (see more: [URL:here|http://en.wikipedia.org/wiki/JSON]). Let's have a look on the example

[XML
{
  "ID": 1234,
  "FirstName": "Radim",
  "LastName": "Köhler",
}
XML]


|H5 200 OK
Part of a response is also the HTTP Status. Success in this case is represented by a value [SAMP:200 OK]



The result would then be processed on a Client application. There could be even more complex object returned, containing internal arrays, complex objects etc. But the principle of getting by ID is still the same.

|H5 404 Not Found
In cases, that URL contains request for ID which does not exists, Web API will return response with a HTTP Status [SAMP: 404 Not Found]


|H2 [NAME:create] Create new
|PR [URL:#top     | TEXT: top]

In case that new Object instance (e.g. Employee) have to be created, we call the Web API like this:

Method [SAMP: POST]
[SAMP:http://server/ems/api/employee/]

In this case, there is no ID at the end of URL, because we are creating new instance. On the other hand, part of that request [B:must] be the [B:Request BODY] containing a JSON describing new instance:

[XML
{
  "FirstName": "Jack",
  "LastName": "Daniel",
}
XML]

|H5 201 Created
If the request will succeed, and the new Employee instance will be persisted, the response to Client application will:

* Have HTTP Status [SAMP: 201 Created]
* Contain a "Location" attribute in the HEAD navigating to the detail of just created instance:
* Have empty BODY


|H5 400 Bad Request
In case, that request could not be processed (insufficient rights, violation of Business rules) the response will:

* Have HTTP Status [SAMP: 400 Bad Request]
* Have BODY containing the Error Messages. E.g.:

[XML
{
  "Messages": [
    {
      "Severity": "ERROR",
      "Description": "There already is an entity Employee (ID: 1234) with similar settings. Unique constraint over: [Login]"
    }
  ]
}
XML]









|H2 [NAME:amend] Amend existing
|PR [URL:#top     | TEXT: top]


Existing objects could be amended. API requires similar content as for creation, the URL must be extended with the ID of currently processed instance. The Method name expressing change is [B:PUT].

Method [SAMP: PUT]
[SAMP:http://server/ems/api/employee/1235]

Similar to creation, the same JSON have to be sent in the [B:Request BODY]:

[XML
{
  "FirstName": "Radim",
  "LastName": "Köhler",
}
XML]


|H5 204 No Content
If the request will succeed, and the existing Employee instance is amended, the response to Client application will:

* Have HTTP Status [SAMP: 204 No Content]
* Contain a "Location" attribute in the HEAD navigating to the detail of just created instance:
* Have empty BODY


|H5 404 Not Found
If the last part of the URL, describing the ID of existing instance, does not match to existing object (Employee with ID 1234 was not found), the response will:

* Have HTTP Status [SAMP: 404 Not Found]
* Have BODY containing the Error Messages. E.g.:

[XML
{
  "Messages": [
    {
      "Severity": "ERROR",
      "Description": "Entity with the ID [1234] was not found"
    }
  ]
}
XML]

|H5 400 Bad Request
Any Validation, Security etc. error will end up with Bad Request. The response will:

* Have HTTP Status [SAMP: 400 Bad Request]
* Have BODY containing the Error Messages. E.g.:

[XML
{
  "Messages": [
    {
      "Severity": "ERROR",
      "Description": "There already is an entity Employee (ID: 2248) with similar settings. Unique constraint over: [Login]"
    }
  ]
}
XML]








|H2 [NAME:delete] Delete
|PR [URL:#top     | TEXT: top]


Delete is an API operation which could be used to remove Existing object. The URL must contain the ID of deleted instance. The Method name expressing change is [B:DELETE], and no Request BODY content is expected.

Method [SAMP: DELETE]
[SAMP:http://server/ems/api/employee/1235]

The [B:Request BODY] is empty.


|H5 204 No Content
If the request will succeed, and the existing Employee instance is deleted, the response to Client application will:

* Have HTTP Status [SAMP: 204 No Content]
* Have empty BODY
* [I:(no Location, instance was deleted)]


|H5 404 Not Found
If the last part of the URL, describing the ID of existing instance, does not match to existing object (Employee with ID 1234 was not found), the response will:

* Have HTTP Status [SAMP: 404 Not Found]
* Have BODY containing the Error Messages. E.g.:

[XML
{
  "Messages": [
    {
      "Severity": "ERROR",
      "Description": "Entity with the ID [1234] was not found"
    }
  ]
}
XML]

|H5 400 Bad Request
Any Validation, Security etc. error will end up with Bad Request. The response will:

* Have HTTP Status [SAMP: 400 Bad Request]
* Have BODY containing the Error Messages. E.g.:

[XML
{
  "Messages": [
    {
      "Severity": "ERROR",
      "Description": "This item 'ID: 1234 - Kohler' is used by [Employee] 'ID: 12345 - Walker' as a property: Manager"
    }
  ]
}
XML]




|H2 [NAME:meta] MetaData
|PR [URL:#top     | TEXT: top]

The Web API as a concept is totally different in comparison with [SAMP:WS - Web Services] (see more: [URL:here|http://en.wikipedia.org/wiki/Web_services]). While each Method of a WS is self-describing via WSDL (see more [URL:Web Services Description Language |http://en.wikipedia.org/wiki/WSDL]), the Web API does not provide similar functionality.

Other words, it is not clear what type of data (JSON) could be received or should be sent. That's why we extended it with the [SAMP:MetaData] principle.

Each Web API Service publishes (among others) also the GET method returning complete description of the Entity

[BQ
* Web API Service in this content means an end point representing Entity (e.g. Employee) with all its CRUD operations (see more [URL: Create,Read,Update,Delete|http://en.wikipedia.org/wiki/CRUD])
* Entity is a common name representing the object (Business object, Code List) which can be handled via Web API Service
BQ]


|H3 How to Get MetaData?

Select the Entity (e.g. Employee) and call the Web API like this:
[SAMP:http://server/ems/api/employee/MetaData]

Another way is to extend the Call with the ID of specific instance, to get more précised information 
[SAMP:http://server/ems/api/employee/MetaData/1234]

The main difference is, that the [B:Current User] [V:Access rights] are evaluated, as well se the context of the Entity instance (e.g. could it be deleted? is not it used?). So, the more restrictive information could be returned in such a case.

Here is (simplified) example:

[XML
{
  "EntityName": "Employee",
  "EntityType": "BusinessObject",
  "CanRead": true,
  "CanEdit": true,
  "CanBeDeleted": true, // returned only in case that ID was provided
  "Attributes": [[]
    {
      "Name": "ID",
      "DisplayName": "ID",
      "PersistenceName": "IdEmployee",
      "DataType": "Int32",
      "IsArray": false,
      "CanQuery": true,
      "CanRead": true,
      "CanEdit": false,
      "ValidationRules": [[]]
    },
 
    ...
 
   // referenced property Country. Each reference is represented by 2 Attributes
   {
      "Name": "Citizenship",
      "DisplayName": "Citizenship",
      "PersistenceName": "IdCitizenship",
      "DataType": "Country",
      "IsArray": false,
      "CanQuery": true,
      "CanRead": true,
      "CanEdit": true,
      "ValidationRules": [[]]
    },
    // any referenced property has its reference ID (the Key) available as well
    {
      "Name": "CitizenshipId",
      "DisplayName": "Citizenship Id",
      "PersistenceName": "IdCitizenship",
      "DataType": "Int32",
      "IsArray": false,
      "CanQuery": true,
      "CanRead": true,
      "CanEdit": true,
      "ValidationRules": [[]]
    },

    ...
 
    // string property
    {
      "Name": "FirstName",
      "DisplayName": "First Name",
      "PersistenceName": "FirstName",
      "DataType": "String",
      "IsArray": false,
      "CanQuery": true,
      "CanRead": true,
      "CanEdit": true,
      "ValidationRules": [[]
        {
          "Type": "length",
          "IsRequired": false,
          "MinLength": 1,
          "MaxLength": 100
        }
      ]
    },

  ...
  // reduced for simplicity
}
XML]


|H3 What are MetaData root settings?

Each Entity MetaData contains overall description at the first place:
[XML
  "EntityName": "Employee",
  "EntityType": "BusinessObject",
  "CanRead": true,
  "CanEdit": true,
  "CanBeDeleted": true, // in case that ID was provided
  "Attributes":...

XML]

The naming should be self descriptive, so put only few more details
* EntityName - the name of Entity. This name also represents the Web API service name. 
* EntityType - the Type of Entity. There are some basic type names in the system, which are mostly intended as a support for Client UI (e.g. CodeList, BusinessObject, Hierarchy). This should help to decide how to render such an entity (TreeView for hierarchical)
* CanRead - is it available to current user at all?
* CanEdit - can current user make any amendments?
* CanBeDeleted - if ID was provided, could be selected instance deleted?
* Attributes - the main collection of all properties of current Entity.

|H3 What is the Attribute?

The [SAMP:Attributes] collection is a set of individual Attributes describing each property. Let's have a closer look on some common Attribute types:



|H4 ATTRIBUTE - String or a ValueType (int, bool, DateTime)

Employee does have a property FirstName. Of which type it is, is there any rule which could be applied on a Client UI? Here should be the answers:

[XML
// string property
{
  "Name": "FirstName",                   // each property must have unique name. e.g. FirstName
  "DisplayName": "First Name",           // Client UI can use this setting as a LABLE name
  "PersistenceName": "FirstName",        // mostly for consistency. What is the name of a Column in DB. Easy way to check issues
  "DataType": "String",                  // essential setting. How should the Client UI represent this value, TEXT field in this case
  "IsArray": false,                      // some properties are arrays. E.g. Addresses property could contain more instance of the Address
  "CanQuery": true,                      // could this property be used for Filtering, Order by..
  "CanRead": true,                       // will this property be sent from a server? Does current user have sufficient rights?
  "CanEdit": true,                       // Any Amendment could be stopped already on the client. If false, Server will reject changes
  "ValidationRules": [[]                   // a collection of ValidationRules, which could be also used on a Client UI
  {
    "Type": "length",                  // this rule is checking the string length
    "IsRequired": false,               // required values cannot be returned as nulls
    "MinLength": 1,                    // the boundaries
    "MaxLength": 100
  }
  ]
},
XML]



|H4 ATTRIBUTE - Referenced Entity

Many of properties are in fact references to other Entities. The Attribute in this case, provide enough information to the Client UI, how to handle that property:

[XML
// referenced property Country. Each reference is represented by 2 Attributes
{
  "Name": "Citizenship",                // property name
  "DisplayName": "Citizenship",        
  "PersistenceName": "IdCitizenship",   // in this case, the name represents the name of column where is the reference Key persisted
  "DataType": "Country",                // EntityName (see above) and DataType are in this case very similar. 
  "IsArray": false,                     //            This Reference DataType is in other words available via "Country" Web API service
  "CanQuery": true,
  "CanRead": true,
  "CanEdit": true,
  "ValidationRules": [[]]               // Empty rules indicate that there are no rules to be simply applied on a Client 
},
// any referenced property has its reference ID (the Key) available as well
{
  "Name": "CitizenshipId",              // this property is the same as the Reference Name with a suffix "Id"
  "DisplayName": "Citizenship Id",
  "PersistenceName": "IdCitizenship",
  "DataType": "Int32",                  // DataType in this case is the Integer value. This value is expected when JSON is passed to server
  "IsArray": false,                     //       Client UI should select a Country (e.g. from a Combobox) and pass selected value as a "CitizenshipId"
  "CanQuery": true,                     // Integer key could also be used for querying!
  "CanRead": true,
  "CanEdit": true,
  "ValidationRules": [[]]
},
XML]



|H4 ATTRIBUTE - Complex internal object (and even array) - Address

There are properties represented by other objects (entities) which are tightly connected to its owner. As a good example we can mention here the [SAMP:Address] instance. These objects cannot be managed separately. They have to be processed inside one walk-through, one transaction. 

For This case, the Web API supports nested properties, and the next (simplified) Attribute shows such case:

[XML
{
  "Name": "Addresses",                // the name of property is plural "Addresses"
  "DisplayName": "Addresses",
  "DataType": "Address",              // while the DataType is represented by an "Address" Entity
  "IsArray": true,                    // and here comes the information: this property can contain more elements
  "CanQuery": false,
  "CanRead": true,
  "CanEdit": true,
  "Attributes": [[]
  {
    // Each Address instance in this case has the ID
    "Name": "ID",
    "DisplayName": "ID",
    "PersistenceName": "IdAddress",
    "DataType": "Int32",
    "IsArray": false,
    "CanQuery": false,
    "CanRead": true,
    "CanEdit": false,
    "ValidationRules": [[]]
  },
  // reference property AddressType
  {
    "Name": "AddressType",             // The Address objects needs reference AddressType
    "DisplayName": "Address Type",     //   which could be available standard way via Web API Service "AddressType"
    "PersistenceName": "IdAddressType",
    "DataType": "AddressType",
    "IsArray": false,
    "CanQuery": false,
    "CanRead": false,
    "CanEdit": true,
    "ValidationRules": [[]]
  }
  // the AddressType key represented as Integer
  {
    "Name": "AddressTypeId",
    "DisplayName": "Address Type Id",
    "PersistenceName": "IdAddressType",
    "DataType": "Int32",
    "IsArray": false,
    "CanQuery": false,
    "CanRead": true,
    "CanEdit": true,
    "ValidationRules": [[]
   {
    "Type": "mandatory",
    "IsRequired": true
   }
  ]
  },
  // the Address string property City
  {
    "Name": "City",
    "DisplayName": "City",
    "PersistenceName": "City",
    "DataType": "String",
    "IsArray": false,
    "CanQuery": false,
    "CanRead": true,
    "CanEdit": true,
    "ValidationRules": [[]          // City property must be provided (is required)
   {
    "Type": "length",               // and have to be at least 1 char long, but not more then 200
    "IsRequired": true,
    "MinLength": 1,
    "MaxLength": 200
   }
  ]
  },
  // and so on
  {
    "Name": "Country",
    ...
  }
 
 ...                                // Finally the Validation rules for the Array property "Addresses"
 
  "ValidationRules": [[]            // There could be only one Address of a AddressTypeId == 1 
   {
    "Type": "multiple",
    "OverProperty": "AddressTypeId",
    "PropertyValue": 1,
    "IsMultiple": false
   },
   {                                // And there could be only one with AddressTypeId == 7
    "Type": "multiple",
    "OverProperty": "AddressTypeId",
    "PropertyValue": 7,
    "IsMultiple": false
   }
  ]
},
XML]


|H3 What is the Action Section?

There are very special entities in the Application domain. These could be named as the Business Objects. They are usually very very complex, but more importantly - they have their own behaviour.

These objects do usually have a [SAMP:State]. The State property represents a moment in their life-time. As a small example, let's assume object which could be (as a business requirement) exist in three states:

* Created
* Active
* Expired

There could be some specific requirements to allow object to move from one [SAMP:State] to another [I:(E.g. more properties then just 'always required' to be filled as well)].
There also could be some restrictions, like only [V:Active] could be moved to [V:Expired]...

The fact is, that all these rules, must be evaluated on the server. But it also should be handy to inform the Client UI Application what are available new [SAMP:States] for current object. And that is exactly the meaning of the [V:Action Section].

Let's assume that object Employee with the ID 1234 is in the [SAMP:State] [V:Created]. The only available next state is at the moment [V:Active]. The MetaData returned by Web API call
[SAMP:http://server/ems/api/employee/MetaData/1234]:

[XML
{
  "EntityName": "Employee",
  "EntityType": "BusinessObject",
 
  ...
  // The Action Section
  "Actions": [[]
    {
      "Name": "MoveToActive",                // the name distinguishing among more actions
      "DisplayName": "Activate",             // text to be displayed on Client UI
      "Location":                            // the URL to be called   
              "http://server/ems/api/employee/Action/1234/MoveToActive",
    }
  ]
}
XML]

The Client UI Application can take this Action section, and create a set of Buttons on the Detail screen. No need to check anything, just consume the prepared data from a server... 








|H2 [NAME:query] Querying, OData protocol support
|PR [URL:#top     | TEXT: top]
 

While the already mentioned Web API methods are very powerful for the Entity handling, we could be missing a way how to effectively render [V:List Views] on a Client UI. 

The [V:List View] UI element should be user friendly in many aspects. It should be able to display columns (properties) which user currently requires. Filtering must be in place as well, to support effective searching functionality. And because many Entities have thousands of rows/instances ... not all data should be returned. Some effective paging should help to quickly receive only small portion of data, and the next.. and next...

That's why we've decided to implement the [V:OData protocol] (see more [URL:Open Data Protocol|http://en.wikipedia.org/wiki/OData] and [URL:here|http://www.odata.org/docs/]) as the [SAMP:Querying engine]. [I:(Well, only parts of it... let's check below what we do have now):]

|H3 Why OData?

It is a standard (tries to be) currently supported by many Web Client UI Frameworks (see more [URL:here|http://www.odata.org/libraries/])

|H3 How it works?

The Web API basic Get method (for example the Employee Service) could look like this:
Method [SAMP: GET]
[SAMP:http://server/ems/api/employee/]

And this will return JSON with a set of instances:

[XML
{
  "d": {
    "__skip": 0,
    "__top": 50,
    "results": [  
  {
    "ID": 1234,
    "FirstName": "Radim",
    "LastName": "Köhler"
  },
  {
    "ID": 1235,
    "FirstName": "John",
    "LastName": "Walker"
  },
  {
    "ID": 1236,
    "FirstName": "Jack",
    "LastName": "Daniel"
  },
  ...
  }
}
XML]

As the very top elements of the result JSON inform us, there was some rows skipped ([SAMP:"__skip": 0]) and only limited amount selected ([SAMP:"__top": 50]). This is a first sign that this Web API method ([SAMP:http://server/ems/api/employee/]) is already doing some kind of "restrictions", instead of returning the complete list of all Employees.

How this could be changed? What else could we do there to restrict the result set? 

Let's have a closer look on the [SAMP:OData options] which are implemented and supported here


|H3 What OData Options are supported?


|H4 [NAME:od_top] $top
|PR [URL:#top     | TEXT: top]

The [SAMP:$top] is a page size selectors. this option decides how many rows will be returned. 

Examples:
* [SAMP:http://server/ems/api/employee/?$top=25] (returns 25 rows or less)
* [SAMP:http://server/ems/api/employee/?$top=50] (returns 50 or less)



|H4 [NAME:od_skip] $skip
|PR [URL:#top     | TEXT: top]

The [SAMP:$skip] is complementary setting to [SAMP:$top] used for paging. It dictates to Web API how many rows should be skipped (e.g. $skip=100 will omit the first one hundred rows)

* [SAMP:http://server/ems/api/employee/?$top=25] - first 25 rows
* [SAMP:http://server/ems/api/employee/?$top=50&amp;$skip=25] -  next 25 rows



|H4 [NAME:od_inlinecount] $inlinecount
|PR [URL:#top     | TEXT: top]

The [SAMP:$inlinecount] is a special option which could have only one value [V:allpages]

* [SAMP:http://server/ems/api/employee/?$inlinecount=allpages] 
The result of such query will be extended with an element [SAMP:__count] contain the row number of all records which would be selected if paging ([SAMP:$skip] and [SAMP:$top]) would not be applied:
[XML
{
  "d": {
    "__count": 12486,
    "__skip": 25,
    "__top": 50,
   ....

XML]




|H4 [NAME:od_orderby] $orderby
|PR [URL:#top     | TEXT: top]

The [SAMP:$orderby] is a comma separated set of properties to be used for sorting. Keywords [V:asc] and [V:desc] can be used to set the ascending (default) or descending.

* [SAMP:http://server/ems/api/employee/?$orderby=FirstName] - ascending order by First name
* [SAMP:http://server/ems/api/employee/?$orderby=LastName desc, FirstName] - firstly order by Last name (descending) then by First name (ascending)





|H4 [NAME:od_select] $select
|PR [URL:#top     | TEXT: top]

The [SAMP:$select] is a comma separated list of properties to be returned. If the result should not contain all data (to reduce the amount of transfereed data) Client UI application can use this option to narrow the result set

* [SAMP:http://server/ems/api/employee/?$select=LastName,ID] - will return just the LastName and ID for each record in the list
[BQ
Some Web API Services (mostly the Complex Entities) could require [SAMP:$select] option to be provided. Otherwise the error will be returned
BQ]

[BQ
The OData sign '*' for select all is [B:NOT] supported. (Error will be returned)
BQ]



|H4 [NAME:od_expand] $expand
|PR [URL:#top     | TEXT: top]

The [SAMP:$expand] is complementary setting to [SAMP:$select]. It is a comma separated list of [B:Referenced] properties. This pair of options ([SAMP:$select] and [SAMP:$expand]) extends the returned values with more details about internal objects

* [SAMP:http://server/ems/api/employee/?$select=ID,LastName,Citizenship/Description&amp;$expand=Citizenship] - will result in:

[XML
  ...
  "results": [  
  {
    "ID": 1234,
    "LastName": "Köhler",
    "Citizenship": {
      "Description": "Czech repbulic"
    },
  },
  ...
XML]


[BQ
The standalone [SAMP:$expand] without [SAMP:$select] is not supported. See [SAMP:$select] limitation of '*' (select all) functionality.
BQ]


|H4 [NAME:od_filter] $filter
|PR [URL:#top     | TEXT: top]

The [SAMP:$filter] is the most powerful option. It allows the Client UI Application to restrict the result-set as user requires.
The concept is in detailed described [URL:here|http://www.odata.org/documentation/odata-v3-documentation/odata-core/#10231_The_filter_System_Query_Option]

Supported operators:
* eq
* le
* ge
* and 
* or (always evaluated as and)

Suported functions:
* substringof('Radim',FirstName)
* startswith(FirstName,'R')
* endswith(FirstName,'m')

AND vs. OR. Or should be used instead of the IN operator in cases, that one Property should be equal to more constants. For Example if the Employee CitizenshipId should be one of these values (1,2,3) use the:
[SAMP:$filter=CitizenshipId eq 1 OR CitizenshipId eq 2 OR  CitizenshipId eq 3]

The engin behind the Web API does not distinguish among AND or OR (all are just filter separators). Only, if there are more properties of the same type (see example above) the IN operation is executed on a server:
CitizenshipId IN (1, 2, 3)

Some examples

* [SAMP:http://server/ems/api/employee/?$filter=FirstName eq Radim] - just employees with FirstName exactly equal to 'Radim'
* [SAMP:http://server/ems/api/employee/?$filter=startswith(FirstName,'R') AND endswith(LastName,'R')] - employees which name starts with 'R' and Last name ends with 'R'
* [SAMP:http://server/ems/api/employee/?$filter=startswith(Citizenship/Code,'C') - all employes with Citizenship, which Country code starts with 'C' (e.g. 'CS')




|H5 400 Bad Request
In case that the OData query will contain some not supported or misspelled parts, the Web API request will:


* Have HTTP Status [SAMP: 400 Bad Request]
* Have BODY containing the Error Messages. E.g.:

[XML
{
  "Messages": [
    {
      "Severity": "WARNING",
      "Description": "Incorrect names used for the SELECT clause"
    },
    {
      "Severity": "ERROR",
      "Description": "Filtering parameters was not correctly filled"
    }
  ]
}
XML]



 
 
 
 
 
 
 
 
 
|PR [URL:#top     | TEXT: top]</Text>
    <HtmlText>&lt;h1&gt;
Web API &lt;a name="top" &gt;&lt;/a&gt;&lt;/h1&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="#basics" title="#basics" &gt; Web API Principles&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#get" title="#get" &gt; Get by ID&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#create" title="#create" &gt; Create new&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#amend" title="#amend" &gt; Amend existing &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#delete" title="#delete" &gt; Delete &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#meta" title="#meta" &gt; MetaData &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#query" title="#query" &gt; Querying, OData protocol support&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#od_top" title="#od_top" &gt; $top&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#od_skip" title="#od_skip" &gt; $skip&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#od_inlinecount" title="#od_inlinecount" &gt; $inlinecount&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#od_orderby" title="#od_orderby" &gt; $orderby&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#od_select" title="#od_select" &gt; $select&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#od_expand" title="#od_expand" &gt; $expand&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#od_filter" title="#od_filter" &gt; $filter&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
&lt;a name="basics" &gt;&lt;/a&gt; Web API Principles&lt;/h2&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Microsoft Official web-site: &lt;a href="http://www.asp.net/web-api/" title="http://www.asp.net/web-api/" &gt;http://www.asp.net/web-api/&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;
What is Web API?&lt;/h3&gt;
&lt;p&gt;The Web API short and MS official description (see more &lt;a href="http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api" title="http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api" &gt;here&lt;/a&gt;)&lt;/p&gt;
&lt;blockquote class="bq" &gt;
ASP.NET Web API is a framework that makes it easy to build HTTP services that reach a broad range of clients, including browsers and mobile devices. ASP.NET Web API is an ideal platform for building RESTful applications on the .NET Framework.&lt;br /&gt;
&lt;/blockquote&gt;
&lt;p&gt;The Web API principles are built on top of the HTTP protocol. The most important features to be mentioned here are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;URL - the unique address (e.g. &lt;samp&gt;http://server/ems/api/employee/1&lt;/samp&gt;)&lt;/li&gt;
&lt;li&gt;HTTP METHOD - the switch giving the URL meaning. e.g. GET to receive data PUT to update existing&lt;/li&gt;
&lt;li&gt;BODY - the content of the request/response. A place where are enclosed data 1) requested or 2) sent from a client&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Let&amp;#39;s put that all together and we can have this overview:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;&lt;tr&gt;&lt;td&gt;Action &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;HTTP method &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;Relative URI&lt;/td&gt;&lt;/tr&gt;&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Get a list of all products &amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;&lt;span style="color:Green;" &gt;GET&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/td&gt;&lt;td&gt;/api/employee&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Get a product by ID &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;&lt;span style="color:Green;" &gt;GET&lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;/api/employee/id&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Querying with OData &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;&lt;span style="color:Green;" &gt;GET&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/td&gt;&lt;td&gt;/api/employee? $filter=startswith(FirstName, &amp;#39;A&amp;#39;) &amp;amp;$orderby=LastName desc &amp;amp;$select=ID, LastName, FirstName&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Create a new product &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;&lt;span style="color:Red;" &gt;POST&lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;/api/employee&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Update a product &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;&lt;span style="color:Red;" &gt;PUT&lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;/api/employee/id&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Delete a product &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;&lt;span style="color:Red;" &gt;DELETE&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;/api/employee/id&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h4&gt;
What is beyond the Web API?&lt;/h4&gt;
&lt;p&gt;The Web API &lt;i&gt;(Application interface)&lt;/i&gt; is a &lt;b&gt;server application&lt;/b&gt;. It sits on a Windows Server 2008+ (or even more in a web-farm of servers -to improve performance) as a web site application, managed by IIS (see: &lt;a href="http://en.wikipedia.org/wiki/Internet_Information_Services" title="http://en.wikipedia.org/wiki/Internet_Information_Services" &gt; Internet Information Service &lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;The Web Server is responding to requests &lt;i&gt;(get data, change existing, post new records)&lt;/i&gt; the standard way, via HTTP Protocol.&lt;/p&gt;
&lt;h4&gt;
What is the benefit of the Web API? &lt;/h4&gt;
&lt;p&gt;The most important thing is, that Web API principle is a way how to separate the fundamental responsibilities. &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Business rules engine (server) vs. &lt;/li&gt;
&lt;li&gt;Client UI(user interface) application. &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;All data handling &lt;i&gt;(loading from DB, ActiveDirectory, xml)&lt;/i&gt; applying business rules, evaluating security is done beyond the Web API. Consumers do not care how these processes are working. They just send requests. If the request is correct, response is returned. If there are any issues (wrong request, wrong data...) consumers are provided with error messages.&lt;/p&gt;
&lt;p&gt;This mostly means that any changes on the server side (Web API) should not affect the Client UI. And also there could be more consumers, different client application consuming the API. Let&amp;#39;s mention the web browser application, WPF smart application or mobile lightweight application.&lt;/p&gt;
&lt;h4&gt;
How does the Web API work?&lt;/h4&gt;
&lt;p&gt;In the next paragraphs, we will see the detailed description of our implementation and design of the Application interface. We will see how to 1) Read data and 2) Write them back.&lt;/p&gt;
&lt;h2&gt;
&lt;a name="get" &gt;&lt;/a&gt; Get by ID&lt;/h2&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The read operations (as Get by ID) are responding to the questions represented by URL. Let&amp;#39;s assume there are two employees in the system:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;&lt;tr&gt;&lt;td&gt;EmployeeID &lt;/td&gt;&lt;td&gt;FirstName &lt;/td&gt;&lt;td&gt;LastName&lt;/td&gt;&lt;/tr&gt;&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/td&gt;&lt;td&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/td&gt;&lt;td&gt;...&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;1234&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;Radim&amp;nbsp;&amp;nbsp; &lt;/td&gt;&lt;td&gt;K&amp;#246;hler&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;1235&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;John&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;Walker&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;The Get by ID action is here to allow client application to get detailed information about any Employee &lt;i&gt;(if security and other rules are met)&lt;/i&gt; by passing the Employee &lt;b&gt;ID&lt;/b&gt;. To do that we have to assemble URL like this:&lt;/p&gt;
&lt;p&gt;Method &lt;samp&gt; GET&lt;/samp&gt;&lt;/p&gt;
&lt;p&gt;&lt;samp&gt;http://server/ems/api/employee/1234&lt;/samp&gt;&lt;/p&gt;
&lt;p&gt;where the meaning of each part of the URL is:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;samp&gt;server&lt;/samp&gt; - is the name of the production server&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;ems&lt;/samp&gt; - the name of application&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;api&lt;/samp&gt; - the switch informing the server that API part of application could be used&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;employee&lt;/samp&gt; - the name of the requested object&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;1234&lt;/samp&gt; - the &lt;b&gt;ID&lt;/b&gt; of requested object&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When the Client application will execute such request, it will be provided with a result in a JSON format (see more: &lt;a href="http://en.wikipedia.org/wiki/JSON" title="http://en.wikipedia.org/wiki/JSON" &gt;here&lt;/a&gt;). Let&amp;#39;s have a look on the example&lt;/p&gt;
&lt;code class="xml" &gt;
&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;ID&amp;quot;&lt;/span&gt;: 1234,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;FirstName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;Radim&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;LastName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;K&amp;#246;hler&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&lt;span class="smbl" &gt;}&lt;/span&gt;&lt;br /&gt;
&lt;/code&gt;
&lt;h5&gt;
200 OK&lt;/h5&gt;
&lt;p&gt;Part of a response is also the HTTP Status. Success in this case is represented by a value &lt;samp&gt;200 OK&lt;/samp&gt;&lt;/p&gt;
&lt;p&gt;The result would then be processed on a Client application. There could be even more complex object returned, containing internal arrays, complex objects etc. But the principle of getting by ID is still the same.&lt;/p&gt;
&lt;h5&gt;
404 Not Found&lt;/h5&gt;
&lt;p&gt;In cases, that URL contains request for ID which does not exists, Web API will return response with a HTTP Status &lt;samp&gt; 404 Not Found&lt;/samp&gt;&lt;/p&gt;
&lt;h2&gt;
&lt;a name="create" &gt;&lt;/a&gt; Create new&lt;/h2&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In case that new Object instance (e.g. Employee) have to be created, we call the Web API like this:&lt;/p&gt;
&lt;p&gt;Method &lt;samp&gt; POST&lt;/samp&gt;&lt;/p&gt;
&lt;p&gt;&lt;samp&gt;http://server/ems/api/employee/&lt;/samp&gt;&lt;/p&gt;
&lt;p&gt;In this case, there is no ID at the end of URL, because we are creating new instance. On the other hand, part of that request &lt;b&gt;must&lt;/b&gt; be the &lt;b&gt;Request BODY&lt;/b&gt; containing a JSON describing new instance:&lt;/p&gt;
&lt;code class="xml" &gt;
&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;FirstName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;Jack&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;LastName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;Daniel&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&lt;span class="smbl" &gt;}&lt;/span&gt;&lt;br /&gt;
&lt;/code&gt;
&lt;h5&gt;
201 Created&lt;/h5&gt;
&lt;p&gt;If the request will succeed, and the new Employee instance will be persisted, the response to Client application will:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Have HTTP Status &lt;samp&gt; 201 Created&lt;/samp&gt;&lt;/li&gt;
&lt;li&gt;Contain a &amp;quot;Location&amp;quot; attribute in the HEAD navigating to the detail of just created instance:&lt;/li&gt;
&lt;li&gt;Have empty BODY&lt;/li&gt;
&lt;/ul&gt;
&lt;h5&gt;
400 Bad Request&lt;/h5&gt;
&lt;p&gt;In case, that request could not be processed (insufficient rights, violation of Business rules) the response will:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Have HTTP Status &lt;samp&gt; 400 Bad Request&lt;/samp&gt;&lt;/li&gt;
&lt;li&gt;Have BODY containing the Error Messages. E.g.:&lt;/li&gt;
&lt;/ul&gt;
&lt;code class="xml" &gt;
&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Messages&amp;quot;&lt;/span&gt;: &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Severity&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;ERROR&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Description&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;There already is an entity Employee (ID: 1234) with similar settings. Unique constraint over: [Login]&amp;quot;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;}&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;]&lt;br /&gt;
&lt;span class="smbl" &gt;}&lt;/span&gt;&lt;br /&gt;
&lt;/code&gt;
&lt;h2&gt;
&lt;a name="amend" &gt;&lt;/a&gt; Amend existing&lt;/h2&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Existing objects could be amended. API requires similar content as for creation, the URL must be extended with the ID of currently processed instance. The Method name expressing change is &lt;b&gt;PUT&lt;/b&gt;.&lt;/p&gt;
&lt;p&gt;Method &lt;samp&gt; PUT&lt;/samp&gt;&lt;/p&gt;
&lt;p&gt;&lt;samp&gt;http://server/ems/api/employee/1235&lt;/samp&gt;&lt;/p&gt;
&lt;p&gt;Similar to creation, the same JSON have to be sent in the &lt;b&gt;Request BODY&lt;/b&gt;:&lt;/p&gt;
&lt;code class="xml" &gt;
&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;FirstName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;Radim&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;LastName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;K&amp;#246;hler&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&lt;span class="smbl" &gt;}&lt;/span&gt;&lt;br /&gt;
&lt;/code&gt;
&lt;h5&gt;
204 No Content&lt;/h5&gt;
&lt;p&gt;If the request will succeed, and the existing Employee instance is amended, the response to Client application will:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Have HTTP Status &lt;samp&gt; 204 No Content&lt;/samp&gt;&lt;/li&gt;
&lt;li&gt;Contain a &amp;quot;Location&amp;quot; attribute in the HEAD navigating to the detail of just created instance:&lt;/li&gt;
&lt;li&gt;Have empty BODY&lt;/li&gt;
&lt;/ul&gt;
&lt;h5&gt;
404 Not Found&lt;/h5&gt;
&lt;p&gt;If the last part of the URL, describing the ID of existing instance, does not match to existing object (Employee with ID 1234 was not found), the response will:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Have HTTP Status &lt;samp&gt; 404 Not Found&lt;/samp&gt;&lt;/li&gt;
&lt;li&gt;Have BODY containing the Error Messages. E.g.:&lt;/li&gt;
&lt;/ul&gt;
&lt;code class="xml" &gt;
&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Messages&amp;quot;&lt;/span&gt;: &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Severity&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;ERROR&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Description&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;Entity with the ID [1234] was not found&amp;quot;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;}&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;]&lt;br /&gt;
&lt;span class="smbl" &gt;}&lt;/span&gt;&lt;br /&gt;
&lt;/code&gt;
&lt;h5&gt;
400 Bad Request&lt;/h5&gt;
&lt;p&gt;Any Validation, Security etc. error will end up with Bad Request. The response will:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Have HTTP Status &lt;samp&gt; 400 Bad Request&lt;/samp&gt;&lt;/li&gt;
&lt;li&gt;Have BODY containing the Error Messages. E.g.:&lt;/li&gt;
&lt;/ul&gt;
&lt;code class="xml" &gt;
&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Messages&amp;quot;&lt;/span&gt;: &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Severity&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;ERROR&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Description&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;There already is an entity Employee (ID: 2248) with similar settings. Unique constraint over: [Login]&amp;quot;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;}&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;]&lt;br /&gt;
&lt;span class="smbl" &gt;}&lt;/span&gt;&lt;br /&gt;
&lt;/code&gt;
&lt;h2&gt;
&lt;a name="delete" &gt;&lt;/a&gt; Delete&lt;/h2&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Delete is an API operation which could be used to remove Existing object. The URL must contain the ID of deleted instance. The Method name expressing change is &lt;b&gt;DELETE&lt;/b&gt;, and no Request BODY content is expected.&lt;/p&gt;
&lt;p&gt;Method &lt;samp&gt; DELETE&lt;/samp&gt;&lt;/p&gt;
&lt;p&gt;&lt;samp&gt;http://server/ems/api/employee/1235&lt;/samp&gt;&lt;/p&gt;
&lt;p&gt;The &lt;b&gt;Request BODY&lt;/b&gt; is empty.&lt;/p&gt;
&lt;h5&gt;
204 No Content&lt;/h5&gt;
&lt;p&gt;If the request will succeed, and the existing Employee instance is deleted, the response to Client application will:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Have HTTP Status &lt;samp&gt; 204 No Content&lt;/samp&gt;&lt;/li&gt;
&lt;li&gt;Have empty BODY&lt;/li&gt;
&lt;li&gt;&lt;i&gt;(no Location, instance was deleted)&lt;/i&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h5&gt;
404 Not Found&lt;/h5&gt;
&lt;p&gt;If the last part of the URL, describing the ID of existing instance, does not match to existing object (Employee with ID 1234 was not found), the response will:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Have HTTP Status &lt;samp&gt; 404 Not Found&lt;/samp&gt;&lt;/li&gt;
&lt;li&gt;Have BODY containing the Error Messages. E.g.:&lt;/li&gt;
&lt;/ul&gt;
&lt;code class="xml" &gt;
&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Messages&amp;quot;&lt;/span&gt;: &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Severity&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;ERROR&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Description&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;Entity with the ID [1234] was not found&amp;quot;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;}&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;]&lt;br /&gt;
&lt;span class="smbl" &gt;}&lt;/span&gt;&lt;br /&gt;
&lt;/code&gt;
&lt;h5&gt;
400 Bad Request&lt;/h5&gt;
&lt;p&gt;Any Validation, Security etc. error will end up with Bad Request. The response will:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Have HTTP Status &lt;samp&gt; 400 Bad Request&lt;/samp&gt;&lt;/li&gt;
&lt;li&gt;Have BODY containing the Error Messages. E.g.:&lt;/li&gt;
&lt;/ul&gt;
&lt;code class="xml" &gt;
&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Messages&amp;quot;&lt;/span&gt;: &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Severity&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;ERROR&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Description&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;This item &amp;#39;ID: 1234 - Kohler&amp;#39; is used by [Employee] &amp;#39;ID: 12345 - Walker&amp;#39; as a property: Manager&amp;quot;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;}&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;]&lt;br /&gt;
&lt;span class="smbl" &gt;}&lt;/span&gt;&lt;br /&gt;
&lt;/code&gt;
&lt;h2&gt;
&lt;a name="meta" &gt;&lt;/a&gt; MetaData&lt;/h2&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The Web API as a concept is totally different in comparison with &lt;samp&gt;WS - Web Services&lt;/samp&gt; (see more: &lt;a href="http://en.wikipedia.org/wiki/Web_services" title="http://en.wikipedia.org/wiki/Web_services" &gt;here&lt;/a&gt;). While each Method of a WS is self-describing via WSDL (see more &lt;a href="http://en.wikipedia.org/wiki/WSDL" title="http://en.wikipedia.org/wiki/WSDL" &gt;Web Services Description Language &lt;/a&gt;), the Web API does not provide similar functionality.&lt;/p&gt;
&lt;p&gt;Other words, it is not clear what type of data (JSON) could be received or should be sent. That&amp;#39;s why we extended it with the &lt;samp&gt;MetaData&lt;/samp&gt; principle.&lt;/p&gt;
&lt;p&gt;Each Web API Service publishes (among others) also the GET method returning complete description of the Entity&lt;/p&gt;
&lt;blockquote class="bq" &gt;
&lt;ul&gt;
&lt;li&gt;Web API Service in this content means an end point representing Entity (e.g. Employee) with all its CRUD operations (see more &lt;a href="http://en.wikipedia.org/wiki/CRUD" title="http://en.wikipedia.org/wiki/CRUD" &gt; Create,Read,Update,Delete&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Entity is a common name representing the object (Business object, Code List) which can be handled via Web API Service&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
How to Get MetaData?&lt;/h3&gt;
&lt;p&gt;Select the Entity (e.g. Employee) and call the Web API like this:&lt;/p&gt;
&lt;p&gt;&lt;samp&gt;http://server/ems/api/employee/MetaData&lt;/samp&gt;&lt;/p&gt;
&lt;p&gt;Another way is to extend the Call with the ID of specific instance, to get more pr&amp;#233;cised information &lt;/p&gt;
&lt;p&gt;&lt;samp&gt;http://server/ems/api/employee/MetaData/1234&lt;/samp&gt;&lt;/p&gt;
&lt;p&gt;The main difference is, that the &lt;b&gt;Current User&lt;/b&gt; &lt;var&gt;Access rights&lt;/var&gt; are evaluated, as well se the context of the Entity instance (e.g. could it be deleted? is not it used?). So, the more restrictive information could be returned in such a case.&lt;/p&gt;
&lt;p&gt;Here is (simplified) example:&lt;/p&gt;
&lt;code class="xml" &gt;
&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;EntityName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;Employee&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;EntityType&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;BusinessObject&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanRead&amp;quot;&lt;/span&gt;: true,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanEdit&amp;quot;&lt;/span&gt;: true,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanBeDeleted&amp;quot;&lt;/span&gt;: true, &lt;span class="cmmnt" &gt;// returned only in case that ID was provided
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Attributes&amp;quot;&lt;/span&gt;: [&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Name&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;ID&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;DisplayName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;ID&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;PersistenceName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;IdEmployee&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;DataType&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;Int32&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;IsArray&amp;quot;&lt;/span&gt;: false,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanQuery&amp;quot;&lt;/span&gt;: true,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanRead&amp;quot;&lt;/span&gt;: true,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanEdit&amp;quot;&lt;/span&gt;: false,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;ValidationRules&amp;quot;&lt;/span&gt;: []&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;}&lt;/span&gt;,&lt;br /&gt;
 &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;...&lt;br /&gt;
 &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;span class="cmmnt" &gt;// referenced property Country. Each reference is represented by 2 Attributes
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Name&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;Citizenship&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;DisplayName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;Citizenship&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;PersistenceName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;IdCitizenship&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;DataType&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;Country&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;IsArray&amp;quot;&lt;/span&gt;: false,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanQuery&amp;quot;&lt;/span&gt;: true,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanRead&amp;quot;&lt;/span&gt;: true,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanEdit&amp;quot;&lt;/span&gt;: true,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;ValidationRules&amp;quot;&lt;/span&gt;: []&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;}&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="cmmnt" &gt;// any referenced property has its reference ID (the Key) available as well
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Name&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;CitizenshipId&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;DisplayName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;Citizenship Id&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;PersistenceName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;IdCitizenship&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;DataType&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;Int32&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;IsArray&amp;quot;&lt;/span&gt;: false,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanQuery&amp;quot;&lt;/span&gt;: true,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanRead&amp;quot;&lt;/span&gt;: true,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanEdit&amp;quot;&lt;/span&gt;: true,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;ValidationRules&amp;quot;&lt;/span&gt;: []&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;}&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;...&lt;br /&gt;
 &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="cmmnt" &gt;// string property
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Name&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;FirstName&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;DisplayName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;First Name&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;PersistenceName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;FirstName&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;DataType&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;String&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;IsArray&amp;quot;&lt;/span&gt;: false,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanQuery&amp;quot;&lt;/span&gt;: true,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanRead&amp;quot;&lt;/span&gt;: true,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanEdit&amp;quot;&lt;/span&gt;: true,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;ValidationRules&amp;quot;&lt;/span&gt;: [&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Type&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;length&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;IsRequired&amp;quot;&lt;/span&gt;: false,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;MinLength&amp;quot;&lt;/span&gt;: 1,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;MaxLength&amp;quot;&lt;/span&gt;: 100&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;}&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;]&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;}&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;...&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="cmmnt" &gt;// reduced for simplicity
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&lt;span class="smbl" &gt;}&lt;/span&gt;&lt;br /&gt;
&lt;/code&gt;
&lt;h3&gt;
What are MetaData root settings?&lt;/h3&gt;
&lt;p&gt;Each Entity MetaData contains overall description at the first place:&lt;/p&gt;
&lt;code class="xml" &gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;EntityName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;Employee&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;EntityType&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;BusinessObject&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanRead&amp;quot;&lt;/span&gt;: true,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanEdit&amp;quot;&lt;/span&gt;: true,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanBeDeleted&amp;quot;&lt;/span&gt;: true, &lt;span class="cmmnt" &gt;// in case that ID was provided
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Attributes&amp;quot;&lt;/span&gt;:...&lt;br /&gt;
&lt;/code&gt;
&lt;p&gt;The naming should be self descriptive, so put only few more details&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;EntityName - the name of Entity. This name also represents the Web API service name. &lt;/li&gt;
&lt;li&gt;EntityType - the Type of Entity. There are some basic type names in the system, which are mostly intended as a support for Client UI (e.g. CodeList, BusinessObject, Hierarchy). This should help to decide how to render such an entity (TreeView for hierarchical)&lt;/li&gt;
&lt;li&gt;CanRead - is it available to current user at all?&lt;/li&gt;
&lt;li&gt;CanEdit - can current user make any amendments?&lt;/li&gt;
&lt;li&gt;CanBeDeleted - if ID was provided, could be selected instance deleted?&lt;/li&gt;
&lt;li&gt;Attributes - the main collection of all properties of current Entity.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
What is the Attribute?&lt;/h3&gt;
&lt;p&gt;The &lt;samp&gt;Attributes&lt;/samp&gt; collection is a set of individual Attributes describing each property. Let&amp;#39;s have a closer look on some common Attribute types:&lt;/p&gt;
&lt;h4&gt;
ATTRIBUTE - String or a ValueType (int, bool, DateTime)&lt;/h4&gt;
&lt;p&gt;Employee does have a property FirstName. Of which type it is, is there any rule which could be applied on a Client UI? Here should be the answers:&lt;/p&gt;
&lt;code class="xml" &gt;
&lt;span class="cmmnt" &gt;// string property
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Name&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;FirstName&amp;quot;&lt;/span&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="cmmnt" &gt;// each property must have unique name. e.g. FirstName
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;DisplayName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;First Name&amp;quot;&lt;/span&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="cmmnt" &gt;// Client UI can use this setting as a LABLE name
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;PersistenceName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;FirstName&amp;quot;&lt;/span&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="cmmnt" &gt;// mostly for consistency. What is the name of a Column in DB. Easy way to check issues
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;DataType&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;String&amp;quot;&lt;/span&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="cmmnt" &gt;// essential setting. How should the Client UI represent this value, TEXT field in this case
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;IsArray&amp;quot;&lt;/span&gt;: false,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="cmmnt" &gt;// some properties are arrays. E.g. Addresses property could contain more instance of the Address
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanQuery&amp;quot;&lt;/span&gt;: true,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="cmmnt" &gt;// could this property be used for Filtering, Order by..
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanRead&amp;quot;&lt;/span&gt;: true,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="cmmnt" &gt;// will this property be sent from a server? Does current user have sufficient rights?
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanEdit&amp;quot;&lt;/span&gt;: true,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="cmmnt" &gt;// Any Amendment could be stopped already on the client. If false, Server will reject changes
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;ValidationRules&amp;quot;&lt;/span&gt;: [&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="cmmnt" &gt;// a collection of ValidationRules, which could be also used on a Client UI
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Type&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;length&amp;quot;&lt;/span&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="cmmnt" &gt;// this rule is checking the string length
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;IsRequired&amp;quot;&lt;/span&gt;: false,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="cmmnt" &gt;// required values cannot be returned as nulls
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;MinLength&amp;quot;&lt;/span&gt;: 1,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="cmmnt" &gt;// the boundaries
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;MaxLength&amp;quot;&lt;/span&gt;: 100&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;}&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;]&lt;br /&gt;
&lt;span class="smbl" &gt;}&lt;/span&gt;,&lt;br /&gt;
&lt;/code&gt;
&lt;h4&gt;
ATTRIBUTE - Referenced Entity&lt;/h4&gt;
&lt;p&gt;Many of properties are in fact references to other Entities. The Attribute in this case, provide enough information to the Client UI, how to handle that property:&lt;/p&gt;
&lt;code class="xml" &gt;
&lt;span class="cmmnt" &gt;// referenced property Country. Each reference is represented by 2 Attributes
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Name&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;Citizenship&amp;quot;&lt;/span&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="cmmnt" &gt;// property name
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;DisplayName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;Citizenship&amp;quot;&lt;/span&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;PersistenceName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;IdCitizenship&amp;quot;&lt;/span&gt;,&amp;nbsp;&amp;nbsp; &lt;span class="cmmnt" &gt;// in this case, the name represents the name of column where is the reference Key persisted
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;DataType&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;Country&amp;quot;&lt;/span&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="cmmnt" &gt;// EntityName (see above) and DataType are in this case very similar. 
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;IsArray&amp;quot;&lt;/span&gt;: false,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="cmmnt" &gt;//            This Reference DataType is in other words available via &amp;quot;Country&amp;quot; Web API service
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanQuery&amp;quot;&lt;/span&gt;: true,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanRead&amp;quot;&lt;/span&gt;: true,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanEdit&amp;quot;&lt;/span&gt;: true,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;ValidationRules&amp;quot;&lt;/span&gt;: []&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="cmmnt" &gt;// Empty rules indicate that there are no rules to be simply applied on a Client 
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&lt;span class="smbl" &gt;}&lt;/span&gt;,&lt;br /&gt;
&lt;span class="cmmnt" &gt;// any referenced property has its reference ID (the Key) available as well
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Name&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;CitizenshipId&amp;quot;&lt;/span&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="cmmnt" &gt;// this property is the same as the Reference Name with a suffix &amp;quot;Id&amp;quot;
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;DisplayName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;Citizenship Id&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;PersistenceName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;IdCitizenship&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;DataType&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;Int32&amp;quot;&lt;/span&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="cmmnt" &gt;// DataType in this case is the Integer value. This value is expected when JSON is passed to server
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;IsArray&amp;quot;&lt;/span&gt;: false,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="cmmnt" &gt;//       Client UI should select a Country (e.g. from a Combobox) and pass selected value as a &amp;quot;CitizenshipId&amp;quot;
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanQuery&amp;quot;&lt;/span&gt;: true,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="cmmnt" &gt;// Integer key could also be used for querying!
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanRead&amp;quot;&lt;/span&gt;: true,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanEdit&amp;quot;&lt;/span&gt;: true,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;ValidationRules&amp;quot;&lt;/span&gt;: []&lt;br /&gt;
&lt;span class="smbl" &gt;}&lt;/span&gt;,&lt;br /&gt;
&lt;/code&gt;
&lt;h4&gt;
ATTRIBUTE - Complex internal object (and even array) - Address&lt;/h4&gt;
&lt;p&gt;There are properties represented by other objects (entities) which are tightly connected to its owner. As a good example we can mention here the &lt;samp&gt;Address&lt;/samp&gt; instance. These objects cannot be managed separately. They have to be processed inside one walk-through, one transaction. &lt;/p&gt;
&lt;p&gt;For This case, the Web API supports nested properties, and the next (simplified) Attribute shows such case:&lt;/p&gt;
&lt;code class="xml" &gt;
&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Name&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;Addresses&amp;quot;&lt;/span&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="cmmnt" &gt;// the name of property is plural &amp;quot;Addresses&amp;quot;
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;DisplayName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;Addresses&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;DataType&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;Address&amp;quot;&lt;/span&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="cmmnt" &gt;// while the DataType is represented by an &amp;quot;Address&amp;quot; Entity
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;IsArray&amp;quot;&lt;/span&gt;: true,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="cmmnt" &gt;// and here comes the information: this property can contain more elements
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanQuery&amp;quot;&lt;/span&gt;: false,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanRead&amp;quot;&lt;/span&gt;: true,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanEdit&amp;quot;&lt;/span&gt;: true,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Attributes&amp;quot;&lt;/span&gt;: [&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="cmmnt" &gt;// Each Address instance in this case has the ID
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Name&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;ID&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;DisplayName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;ID&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;PersistenceName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;IdAddress&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;DataType&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;Int32&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;IsArray&amp;quot;&lt;/span&gt;: false,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanQuery&amp;quot;&lt;/span&gt;: false,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanRead&amp;quot;&lt;/span&gt;: true,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanEdit&amp;quot;&lt;/span&gt;: false,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;ValidationRules&amp;quot;&lt;/span&gt;: []&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;}&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="cmmnt" &gt;// reference property AddressType
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Name&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;AddressType&amp;quot;&lt;/span&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="cmmnt" &gt;// The Address objects needs reference AddressType
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;DisplayName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;Address Type&amp;quot;&lt;/span&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="cmmnt" &gt;//   which could be available standard way via Web API Service &amp;quot;AddressType&amp;quot;
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;PersistenceName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;IdAddressType&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;DataType&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;AddressType&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;IsArray&amp;quot;&lt;/span&gt;: false,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanQuery&amp;quot;&lt;/span&gt;: false,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanRead&amp;quot;&lt;/span&gt;: false,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanEdit&amp;quot;&lt;/span&gt;: true,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;ValidationRules&amp;quot;&lt;/span&gt;: []&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;}&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="cmmnt" &gt;// the AddressType key represented as Integer
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Name&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;AddressTypeId&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;DisplayName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;Address Type Id&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;PersistenceName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;IdAddressType&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;DataType&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;Int32&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;IsArray&amp;quot;&lt;/span&gt;: false,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanQuery&amp;quot;&lt;/span&gt;: false,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanRead&amp;quot;&lt;/span&gt;: true,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanEdit&amp;quot;&lt;/span&gt;: true,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;ValidationRules&amp;quot;&lt;/span&gt;: [&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Type&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;mandatory&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;IsRequired&amp;quot;&lt;/span&gt;: true&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;span class="smbl" &gt;}&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;]&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;}&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="cmmnt" &gt;// the Address string property City
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Name&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;City&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;DisplayName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;City&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;PersistenceName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;City&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;DataType&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;String&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;IsArray&amp;quot;&lt;/span&gt;: false,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanQuery&amp;quot;&lt;/span&gt;: false,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanRead&amp;quot;&lt;/span&gt;: true,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;CanEdit&amp;quot;&lt;/span&gt;: true,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;ValidationRules&amp;quot;&lt;/span&gt;: [&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="cmmnt" &gt;// City property must be provided (is required)
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Type&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;length&amp;quot;&lt;/span&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="cmmnt" &gt;// and have to be at least 1 char long, but not more then 200
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;IsRequired&amp;quot;&lt;/span&gt;: true,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;MinLength&amp;quot;&lt;/span&gt;: 1,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;MaxLength&amp;quot;&lt;/span&gt;: 200&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;span class="smbl" &gt;}&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;]&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;}&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="cmmnt" &gt;// and so on
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Name&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;Country&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;...&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;}&lt;/span&gt;&lt;br /&gt;
 &lt;br /&gt;
 ...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="cmmnt" &gt;// Finally the Validation rules for the Array property &amp;quot;Addresses&amp;quot;
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;ValidationRules&amp;quot;&lt;/span&gt;: [&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="cmmnt" &gt;// There could be only one Address of a AddressTypeId == 1 
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Type&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;multiple&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;OverProperty&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;AddressTypeId&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;PropertyValue&amp;quot;&lt;/span&gt;: 1,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;IsMultiple&amp;quot;&lt;/span&gt;: false&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;span class="smbl" &gt;}&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;span class="smbl" &gt;{&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="cmmnt" &gt;// And there could be only one with AddressTypeId == 7
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Type&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;multiple&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;OverProperty&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;AddressTypeId&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;PropertyValue&amp;quot;&lt;/span&gt;: 7,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;IsMultiple&amp;quot;&lt;/span&gt;: false&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;span class="smbl" &gt;}&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;]&lt;br /&gt;
&lt;span class="smbl" &gt;}&lt;/span&gt;,&lt;br /&gt;
&lt;/code&gt;
&lt;h3&gt;
What is the Action Section?&lt;/h3&gt;
&lt;p&gt;There are very special entities in the Application domain. These could be named as the Business Objects. They are usually very very complex, but more importantly - they have their own behaviour.&lt;/p&gt;
&lt;p&gt;These objects do usually have a &lt;samp&gt;State&lt;/samp&gt;. The State property represents a moment in their life-time. As a small example, let&amp;#39;s assume object which could be (as a business requirement) exist in three states:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Created&lt;/li&gt;
&lt;li&gt;Active&lt;/li&gt;
&lt;li&gt;Expired&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There could be some specific requirements to allow object to move from one &lt;samp&gt;State&lt;/samp&gt; to another &lt;i&gt;(E.g. more properties then just &amp;#39;always required&amp;#39; to be filled as well)&lt;/i&gt;.&lt;/p&gt;
&lt;p&gt;There also could be some restrictions, like only &lt;var&gt;Active&lt;/var&gt; could be moved to &lt;var&gt;Expired&lt;/var&gt;...&lt;/p&gt;
&lt;p&gt;The fact is, that all these rules, must be evaluated on the server. But it also should be handy to inform the Client UI Application what are available new &lt;samp&gt;States&lt;/samp&gt; for current object. And that is exactly the meaning of the &lt;var&gt;Action Section&lt;/var&gt;.&lt;/p&gt;
&lt;p&gt;Let&amp;#39;s assume that object Employee with the ID 1234 is in the &lt;samp&gt;State&lt;/samp&gt; &lt;var&gt;Created&lt;/var&gt;. The only available next state is at the moment &lt;var&gt;Active&lt;/var&gt;. The MetaData returned by Web API call&lt;/p&gt;
&lt;p&gt;&lt;samp&gt;http://server/ems/api/employee/MetaData/1234&lt;/samp&gt;:&lt;/p&gt;
&lt;code class="xml" &gt;
&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;EntityName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;Employee&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;EntityType&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;BusinessObject&amp;quot;&lt;/span&gt;,&lt;br /&gt;
 &lt;br /&gt;
&amp;nbsp;&amp;nbsp;...&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="cmmnt" &gt;// The Action Section
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Actions&amp;quot;&lt;/span&gt;: [&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Name&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;MoveToActive&amp;quot;&lt;/span&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="cmmnt" &gt;// the name distinguishing among more actions
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;DisplayName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;Activate&amp;quot;&lt;/span&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="cmmnt" &gt;// text to be displayed on Client UI
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Location&amp;quot;&lt;/span&gt;:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="cmmnt" &gt;// the URL to be called   
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;http://server/ems/api/employee/Action/1234/MoveToActive&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;}&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;]&lt;br /&gt;
&lt;span class="smbl" &gt;}&lt;/span&gt;&lt;br /&gt;
&lt;/code&gt;
&lt;p&gt;The Client UI Application can take this Action section, and create a set of Buttons on the Detail screen. No need to check anything, just consume the prepared data from a server... &lt;/p&gt;
&lt;h2&gt;
&lt;a name="query" &gt;&lt;/a&gt; Querying, OData protocol support&lt;/h2&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;While the already mentioned Web API methods are very powerful for the Entity handling, we could be missing a way how to effectively render &lt;var&gt;List Views&lt;/var&gt; on a Client UI. &lt;/p&gt;
&lt;p&gt;The &lt;var&gt;List View&lt;/var&gt; UI element should be user friendly in many aspects. It should be able to display columns (properties) which user currently requires. Filtering must be in place as well, to support effective searching functionality. And because many Entities have thousands of rows/instances ... not all data should be returned. Some effective paging should help to quickly receive only small portion of data, and the next.. and next...&lt;/p&gt;
&lt;p&gt;That&amp;#39;s why we&amp;#39;ve decided to implement the &lt;var&gt;OData protocol&lt;/var&gt; (see more &lt;a href="http://en.wikipedia.org/wiki/OData" title="http://en.wikipedia.org/wiki/OData" &gt;Open Data Protocol&lt;/a&gt; and &lt;a href="http://www.odata.org/docs/" title="http://www.odata.org/docs/" &gt;here&lt;/a&gt;) as the &lt;samp&gt;Querying engine&lt;/samp&gt;. &lt;i&gt;(Well, only parts of it... let&amp;#39;s check below what we do have now):&lt;/i&gt;&lt;/p&gt;
&lt;h3&gt;
Why OData?&lt;/h3&gt;
&lt;p&gt;It is a standard (tries to be) currently supported by many Web Client UI Frameworks (see more &lt;a href="http://www.odata.org/libraries/" title="http://www.odata.org/libraries/" &gt;here&lt;/a&gt;)&lt;/p&gt;
&lt;h3&gt;
How it works?&lt;/h3&gt;
&lt;p&gt;The Web API basic Get method (for example the Employee Service) could look like this:&lt;/p&gt;
&lt;p&gt;Method &lt;samp&gt; GET&lt;/samp&gt;&lt;/p&gt;
&lt;p&gt;&lt;samp&gt;http://server/ems/api/employee/&lt;/samp&gt;&lt;/p&gt;
&lt;p&gt;And this will return JSON with a set of instances:&lt;/p&gt;
&lt;code class="xml" &gt;
&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;d&amp;quot;&lt;/span&gt;: &lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;__skip&amp;quot;&lt;/span&gt;: 0,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;__top&amp;quot;&lt;/span&gt;: 50,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;results&amp;quot;&lt;/span&gt;: &amp;nbsp;&amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;ID&amp;quot;&lt;/span&gt;: 1234,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;FirstName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;Radim&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;LastName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;K&amp;#246;hler&amp;quot;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;}&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;ID&amp;quot;&lt;/span&gt;: 1235,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;FirstName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;John&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;LastName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;Walker&amp;quot;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;}&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;ID&amp;quot;&lt;/span&gt;: 1236,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;FirstName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;Jack&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;LastName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;Daniel&amp;quot;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;}&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;...&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class="smbl" &gt;}&lt;/span&gt;&lt;br /&gt;
&lt;/code&gt;
&lt;p&gt;As the very top elements of the result JSON inform us, there was some rows skipped (&lt;samp&gt;&amp;quot;__skip&amp;quot;: 0&lt;/samp&gt;) and only limited amount selected (&lt;samp&gt;&amp;quot;__top&amp;quot;: 50&lt;/samp&gt;). This is a first sign that this Web API method (&lt;samp&gt;http://server/ems/api/employee/&lt;/samp&gt;) is already doing some kind of &amp;quot;restrictions&amp;quot;, instead of returning the complete list of all Employees.&lt;/p&gt;
&lt;p&gt;How this could be changed? What else could we do there to restrict the result set? &lt;/p&gt;
&lt;p&gt;Let&amp;#39;s have a closer look on the &lt;samp&gt;OData options&lt;/samp&gt; which are implemented and supported here&lt;/p&gt;
&lt;h3&gt;
What OData Options are supported?&lt;/h3&gt;
&lt;h4&gt;
&lt;a name="od_top" &gt;&lt;/a&gt; $top&lt;/h4&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The &lt;samp&gt;$top&lt;/samp&gt; is a page size selectors. this option decides how many rows will be returned. &lt;/p&gt;
&lt;p&gt;Examples:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;samp&gt;http://server/ems/api/employee/?$top=25&lt;/samp&gt; (returns 25 rows or less)&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;http://server/ems/api/employee/?$top=50&lt;/samp&gt; (returns 50 or less)&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;
&lt;a name="od_skip" &gt;&lt;/a&gt; $skip&lt;/h4&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The &lt;samp&gt;$skip&lt;/samp&gt; is complementary setting to &lt;samp&gt;$top&lt;/samp&gt; used for paging. It dictates to Web API how many rows should be skipped (e.g. $skip=100 will omit the first one hundred rows)&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;samp&gt;http://server/ems/api/employee/?$top=25&lt;/samp&gt; - first 25 rows&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;http://server/ems/api/employee/?$top=50&amp;amp;$skip=25&lt;/samp&gt; -&amp;nbsp;&amp;nbsp;next 25 rows&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;
&lt;a name="od_inlinecount" &gt;&lt;/a&gt; $inlinecount&lt;/h4&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The &lt;samp&gt;$inlinecount&lt;/samp&gt; is a special option which could have only one value &lt;var&gt;allpages&lt;/var&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;samp&gt;http://server/ems/api/employee/?$inlinecount=allpages&lt;/samp&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The result of such query will be extended with an element &lt;samp&gt;__count&lt;/samp&gt; contain the row number of all records which would be selected if paging (&lt;samp&gt;$skip&lt;/samp&gt; and &lt;samp&gt;$top&lt;/samp&gt;) would not be applied:&lt;/p&gt;
&lt;code class="xml" &gt;
&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;d&amp;quot;&lt;/span&gt;: &lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;__count&amp;quot;&lt;/span&gt;: 12486,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;__skip&amp;quot;&lt;/span&gt;: 25,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;__top&amp;quot;&lt;/span&gt;: 50,&lt;br /&gt;
&amp;nbsp;&amp;nbsp; ....&lt;br /&gt;
&lt;/code&gt;
&lt;h4&gt;
&lt;a name="od_orderby" &gt;&lt;/a&gt; $orderby&lt;/h4&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The &lt;samp&gt;$orderby&lt;/samp&gt; is a comma separated set of properties to be used for sorting. Keywords &lt;var&gt;asc&lt;/var&gt; and &lt;var&gt;desc&lt;/var&gt; can be used to set the ascending (default) or descending.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;samp&gt;http://server/ems/api/employee/?$orderby=FirstName&lt;/samp&gt; - ascending order by First name&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;http://server/ems/api/employee/?$orderby=LastName desc, FirstName&lt;/samp&gt; - firstly order by Last name (descending) then by First name (ascending)&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;
&lt;a name="od_select" &gt;&lt;/a&gt; $select&lt;/h4&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The &lt;samp&gt;$select&lt;/samp&gt; is a comma separated list of properties to be returned. If the result should not contain all data (to reduce the amount of transfereed data) Client UI application can use this option to narrow the result set&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;samp&gt;http://server/ems/api/employee/?$select=LastName,ID&lt;/samp&gt; - will return just the LastName and ID for each record in the list&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote class="bq" &gt;
Some Web API Services (mostly the Complex Entities) could require &lt;samp&gt;$select&lt;/samp&gt; option to be provided. Otherwise the error will be returned&lt;br /&gt;
&lt;/blockquote&gt;
&lt;blockquote class="bq" &gt;
The OData sign &amp;#39;&lt;b&gt;&amp;#39; for select all is&lt;/b&gt; &lt;b&gt;NOT&lt;/b&gt; supported. (Error will be returned)&lt;br /&gt;
&lt;/blockquote&gt;
&lt;h4&gt;
&lt;a name="od_expand" &gt;&lt;/a&gt; $expand&lt;/h4&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The &lt;samp&gt;$expand&lt;/samp&gt; is complementary setting to &lt;samp&gt;$select&lt;/samp&gt;. It is a comma separated list of &lt;b&gt;Referenced&lt;/b&gt; properties. This pair of options (&lt;samp&gt;$select&lt;/samp&gt; and &lt;samp&gt;$expand&lt;/samp&gt;) extends the returned values with more details about internal objects&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;samp&gt;http://server/ems/api/employee/?$select=ID,LastName,Citizenship/Description&amp;amp;$expand=Citizenship&lt;/samp&gt; - will result in:&lt;/li&gt;
&lt;/ul&gt;
&lt;code class="xml" &gt;
&amp;nbsp;&amp;nbsp;...&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;results&amp;quot;&lt;/span&gt;: &amp;nbsp;&amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;ID&amp;quot;&lt;/span&gt;: 1234,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;LastName&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;K&amp;#246;hler&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Citizenship&amp;quot;&lt;/span&gt;: &lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Description&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;Czech repbulic&amp;quot;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;}&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;}&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;...&lt;br /&gt;
&lt;/code&gt;
&lt;blockquote class="bq" &gt;
The standalone &lt;samp&gt;$expand&lt;/samp&gt; without &lt;samp&gt;$select&lt;/samp&gt; is not supported. See &lt;samp&gt;$select&lt;/samp&gt; limitation of &amp;#39;*&amp;#39; (select all) functionality.&lt;br /&gt;
&lt;/blockquote&gt;
&lt;h4&gt;
&lt;a name="od_filter" &gt;&lt;/a&gt; $filter&lt;/h4&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The &lt;samp&gt;$filter&lt;/samp&gt; is the most powerful option. It allows the Client UI Application to restrict the result-set as user requires.&lt;/p&gt;
&lt;p&gt;The concept is in detailed described &lt;a href="http://www.odata.org/documentation/odata-v3-documentation/odata-core/#10231_The_filter_System_Query_Option" title="http://www.odata.org/documentation/odata-v3-documentation/odata-core/#10231_The_filter_System_Query_Option" &gt;here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Supported operators:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;eq&lt;/li&gt;
&lt;li&gt;le&lt;/li&gt;
&lt;li&gt;ge&lt;/li&gt;
&lt;li&gt;and &lt;/li&gt;
&lt;li&gt;or (always evaluated as and)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Suported functions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;substringof(&amp;#39;Radim&amp;#39;,FirstName)&lt;/li&gt;
&lt;li&gt;startswith(FirstName,&amp;#39;R&amp;#39;)&lt;/li&gt;
&lt;li&gt;endswith(FirstName,&amp;#39;m&amp;#39;)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;AND vs. OR. Or should be used instead of the IN operator in cases, that one Property should be equal to more constants. For Example if the Employee CitizenshipId should be one of these values (1,2,3) use the:&lt;/p&gt;
&lt;p&gt;&lt;samp&gt;$filter=CitizenshipId eq 1 OR CitizenshipId eq 2 OR&amp;nbsp;&amp;nbsp;CitizenshipId eq 3&lt;/samp&gt;&lt;/p&gt;
&lt;p&gt;The engin behind the Web API does not distinguish among AND or OR (all are just filter separators). Only, if there are more properties of the same type (see example above) the IN operation is executed on a server:&lt;/p&gt;
&lt;p&gt;CitizenshipId IN (1, 2, 3)&lt;/p&gt;
&lt;p&gt;Some examples&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;samp&gt;http://server/ems/api/employee/?$filter=FirstName eq Radim&lt;/samp&gt; - just employees with FirstName exactly equal to &amp;#39;Radim&amp;#39;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;http://server/ems/api/employee/?$filter=startswith(FirstName,&amp;#39;R&amp;#39;) AND endswith(LastName,&amp;#39;R&amp;#39;)&lt;/samp&gt; - employees which name starts with &amp;#39;R&amp;#39; and Last name ends with &amp;#39;R&amp;#39;&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;http://server/ems/api/employee/?$filter=startswith(Citizenship/Code,&amp;#39;C&amp;#39;) - all employes with Citizenship, which Country code starts with &amp;#39;C&amp;#39; (e.g. &amp;#39;CS&amp;#39;)&lt;/samp&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h5&gt;
400 Bad Request&lt;/h5&gt;
&lt;p&gt;In case that the OData query will contain some not supported or misspelled parts, the Web API request will:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Have HTTP Status &lt;samp&gt; 400 Bad Request&lt;/samp&gt;&lt;/li&gt;
&lt;li&gt;Have BODY containing the Error Messages. E.g.:&lt;/li&gt;
&lt;/ul&gt;
&lt;code class="xml" &gt;
&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Messages&amp;quot;&lt;/span&gt;: &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Severity&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;WARNING&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Description&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;Incorrect names used for the SELECT clause&amp;quot;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;}&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Severity&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;ERROR&amp;quot;&lt;/span&gt;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="qtd" &gt;&amp;quot;Description&amp;quot;&lt;/span&gt;: &lt;span class="qtd" &gt;&amp;quot;Filtering parameters was not correctly filled&amp;quot;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="smbl" &gt;}&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;]&lt;br /&gt;
&lt;span class="smbl" &gt;}&lt;/span&gt;&lt;br /&gt;
&lt;/code&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
</HtmlText>
  </Article>
  <Article ID="7" CreationDate="2013-04-25T16:50:51.1267964+02:00" LastUpdateDate="2013-05-02T16:36:16.0045266+02:00" ReleaseDate="2013-04-25T17:14:17.2337964+02:00" IsVisible="true" ShowComment="true" Code="Architecture" Title="The Architecture of the Web API" Description="The brief overview of the Web API Architecture. Components, tiers, layers, patterns. How is the Application Server  organized? What are the main concepts &amp; patterns?" ArticleCategoryId="2" ArticleGroupId="2">
    <Text>|H1 The Web API Architecture [NAME:top]

[NUM
[URL:#tech|TEXT: Technology overview]
[URL:#tier|TEXT: Architectural tiers]
[LI
[URL:#peti|TEXT: Persistence tier]
[URL:#apti|TEXT: Application tier]
[URL:#clti|TEXT: Client tier]
LI]
[URL:#arch|TEXT: Patterns &amp; practices Application Architecture]
[URL:#layr|TEXT: Layered Architecture]
[LI
[URL:#data|TEXT: Data layer]
[URL:#busi|TEXT: Business layer]
[URL:#serv|TEXT: Service layer]
[URL:#cros|TEXT: Cross-cutting concepts]
LI]
[URL:#desg|TEXT: Design Patterns]
NUM]


|H2 [NAME:tech] Technology overview
|PR [URL:#top     | TEXT: top]

A list of used technologies
[LI
MS Windows Server 2008+
MS SQL Server 2008+
MS IIS 7+
VS 2012
MS .NET 4.5+ (C#)
NHibernate 3+
Json.NET
OpenXML
MS Web API infrastructure
ODAta v 2.0
LI]

[B:Persistence tier]

The key part of the [SAMP:Persistence tier] is the [B:Database] - [V:MS SQL Server 2008]+. There are also other types of data storages: [V:File System]s on dedicated servers accessed as the [V:file-shares] [I:(images, files)]. We are also reading some information from [V:Active Directory]. There are some connection to other systems as well, e.g. [V:Web Services], [V:Data exports] [I:(text files)] etc.


[B:Application tier]

The [B: Web API] is in fact [B:Application Server] [I:(so called [SAMP:Application tier], see below)]. It is deployed on [V:MS Windows Server 2008+], and communicates with its [I:Consumers] [I:(so called [SAMP:Client tier] via [V:HTTP protocol], see more [URL:here|http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol])]. The Application is a part of the MS IIS [I:(see [URL:Internet Information Services|http://en.wikipedia.org/wiki/Internet_Information_Services])]

The [B:Application Server] communicates with the Database via [V:MS ADO.NET]. As a runtime we are using [V: MS .NET 4.5+], the programming language is [V:C#]. Solution is developed in [V:MS Visual Studio 2012+]

The [B:Application Server] has a [B:Layered Architecture] [I:(see more below)]. Each of the layers has specific concern and uses many external components. 

The [SAMP:Data Layer] profits from ORM [I:(see: [URL:Object-relational mapping|http://en.wikipedia.org/wiki/Object-relational_mapping])] engine [URL:NHibernate|http://en.wikipedia.org/wiki/NHibernate]. 

The [SAMP:Service Layer] is handling requests and sending results in a [URL:JSON|http://en.wikipedia.org/wiki/JSON] format, the engine used is [URL: Json.NET|http://james.newtonking.com/projects/json/help/]

Other components used are [URL:Log4NET|http://logging.apache.org/log4net/], MS [URL:Web API|http://www.asp.net/web-api] infrastructure, IoC Container [URL:StructureMap|http://structuremap.net/] [I:(see more: [URL:Inversion of control|http://en.wikipedia.org/wiki/Inversion_of_control])], the MS Office documents are processed with [URL:MS OpenXML|http://en.wikipedia.org/wiki/Office_Open_XML] API.

The [B:Web API] uses [V:REST architectural style] [I:(see:[URL:Representational state transfer|https://en.wikipedia.org/wiki/Representational_state_transfer])]. To get more and farther details about The Web API implementation, please see [URL:/Articles/Code/WebAPIOverview|TEXT:The concept of the Web API for]

As a querying standard, we've implemented [I:(partially)] the [V:OData protocol] [I:(see more [URL:Open Data Protocol|https://en.wikipedia.org/wiki/OData])]. This way, any consumer can filter, sort and limit results returned by the Web API [I:(e.g. ListView, sorted by name, only first 20 rows displayed on the first page)]



[IMG:/files/Architecture/TechSummary.jpg|WIDTH:800px|HEIGHT:496px]













|H2 [NAME:tier] Architectural tiers
|PR [URL:#top     | TEXT: top]

The most complex view of the overall Architecture used in our Solution could be split into 3 independent tiers:

# Database [SAMP: Persistence tier]
# Application Server  [SAMP: Application tier]
# Consumers, Client Applications  [SAMP: Client tier]


Next diagram distinguishes these tiers as [B:really indendent] blocks. Firstly, they are deployed on different Servers and HW, so they are really split. They do comunicate with each other via known, published [B:API] [I:(see more [URL:here|https://en.wikipedia.org/wiki/API])]. That is, each tier does its job regardless of the other. From development/maintenance perspective this means that we can concentrate on different requirements in a different time period on any of these tiers.

|H6 3-tiers Architecture

[IMG:/files/Architecture/3Tier.jpg|WIDTH:800px|HEIGHT:598px]




|H4 [NAME:peti] Database [SAMP: Persistence tier]
|PR [URL:#top     | TEXT: top]


The [SAMP:Persistence tier] [I:(Database MS SQL Server mostly)] is responsible for 1) data consistency and 2) performance. 

While The [SAMP:Application tier] [I:(see below)] is responsible of the consistency from the Business perspective [I:(i.e. it should not allow delete the item which is still in use)], the Database should double these checks. Any constraints, reference checks, transaction scope changes etc. are one of the key parts of the [SAMP:Persistence tier].

Performance optimization is the second fundament of the [SAMP:Persistence tier]. Regardless of the "not efficient" queries [I:(coming from Application or Client tiers)], the real power of SQL Engine is used and granted here [I:(Clustered and Non-clustered Indexes, full-text catalogues, optimized data types...)]


|H4 [NAME:apti] Application Server [SAMP: Application tier]
|PR [URL:#top     | TEXT: top]


The [SAMP:Application tier] represents a concept of separation of concern. There are no limitations of the UI here. There is loose dependency of the underlying persistence structure. The only concern is the application of [B:Business rules] [I:(the security is part of them)]

At the end, [SAMP:Application tier] publishes CRUD operations [I:(see [URL:https://en.wikipedia.org/wiki/CRUD|TEXT:Create, read, update and delete])] to the Consumers, Client Applications. These API operations/methods are granted to follow all business requirements, will apply all rules, and check the Application consistency [I:(e.g. handle the concurrency issues)]

It also extends support of a [SAMP:Client tier] with the [SAMP:MetaData] concept. It could be seen as a service, as a communication way to the Client Application describing: what could be done, what are available next steps. It takes into account not only current entity [I:(e.g. Employee record)] but the [B:current user] security context as well.

Other words, Client Applications are not only provided with resume of their actions [I:(e.g. create, update)] ex post. But they do have enough information even before the action is called at all [I:(is it allowed to delete current record?)]

The [SAMP:Application tier] is central point of ourWeb API.


|H4 [NAME:clti] Consumers, Client Applications [SAMP: Client tier]
|PR [URL:#top     | TEXT: top]

The User Interface [I:(UI)], PC, modern devices, "User experience"... these are building blocks of the [SAMP:Client tier]. There could be many HW devices [I:(PC, Tablet, Mobile phone)], many technologies [I:(Rich WPF application, light web-mobile summary)]. These can provide nice independent views on top of calls to Web API. They do not have to care about the Business rules. It is already done on [SAMP:Application tier]. Client Applications just can do some pre-checks ([SAMP:MetaData] concept), but the main concern is user experience.

The benefit of the 3-tier Architecture was already proven on many projects, in many companies. While all Business rules, security, logging... is granted to be done on one place ([SAMP:Application tier]), there could be one or many Client Applications consuming the same API, but each with different goal. 

These, Client Applications, do have its own concern: Provide the ultimate user experience. Easy navigation, simple editing, smart ListViews, with paging. Providing the merge of other API services [I:(Get an Employee record from Web API, while ask for its Photo another service)].

Clearly, Client Applications do not have to handle all the complexity of the Business rules. They simply call Get or Find.. and if needed they Amend or Insert new values. With a MetaData concepts, Consumers can extend the UI with available actions  [I:(e.g. for a workflow - User will immediately know what are next states of currently selected Entity)].


|H5 Summary

The concept of 3-tier Architecture should bring much more better User experience. There could be many, very different [B:Client Applications] [I:(Mobile for a quick overview vs Rich "fat" clients for a bulk editing...)]. There is only one Ruler, one place granting all Consumers that the actions will be correctly handled. This is the [B:Application Server]. And [SAMP:Persistence tier] concentrates on data consistency and fast querying.










|H2 [NAME:arch] Patterns &amp; practices Application Architecture
|PR [URL:#top     | TEXT: top]

In previous section we've seen that Web API is a middle tier, the [SAMP:Application tier], in the 3-tier Architecture. Next sections will take us into more detailed discussion about Application Server and its [SAMP:Layered Architecture]

The Web API, Application Server is built on top of the [GREEN:patterns &amp; practices Application Architecture] published by Microsoft (see more [URL:here|https://apparchguide.codeplex.com/])

Short extract:

[BQ
This guide provides design-level guidance for the architecture and design of applications built on the .NET Framework. It focuses on the most common types of applications, partitioning application functionality into layers, components, and services, and walks through their key design characteristics. This guide is a collaborative effort between patterns &amp; practices, product teams, and industry experts.
BQ]

Let's start with an overview. The MS Guidance provides this drawing: 

[I:(Drawing taken from [URL:https://apparchguide.codeplex.com/|TEXT: Microsoft Application Architecture Guide] 2[SUP:nd] Edition)]
[IMG:/files/Architecture/Architecture.png]




|H3 Separation of concern
The first look on a visualize Layered Architecture shows, that the key to success is a separation of concern. There are building blocks, large one, called layers. These are in fact built of other (smaller) blocks (see [URL:design patterns|https://en.wikipedia.org/wiki/Design_patterns]). 

This approach [I:(if successfully implemented and followed)] brings many advantages. Let's mention at least few of them

* [SAMP:Loose Dependency]. Each layer is independent. There is no direct connectivity. The communication is done (as indicates Cross Cutting block) over commonly published [V:interfaces]. (see more here: [URL:Loose coupling|http://en.wikipedia.org/wiki/Loose_coupling]) 
* [SAMP:Responsibility]. Each layer has its own responsibility(-ies) (e.g. rules validation, SQL statement execution etc.) which cannot be done elswhere. If there is any requirement on the Application, it is clear and obvious how and where will be handled (i.e. Business rules are evaluated on a Business Layer, while the SQL Scripts are under the domain of the Data layer)
* [SAMP:Extensibility]. Each layer can be extended. It can provide more functionality, while it never will break the current one. That's thanks to [URL: Open/Close principle|http://en.wikipedia.org/wiki/Open/closed_principle]. 
* [SAMP:Maintenance]. In cases that The Application needs to be amended (to fix a bug, implement change) it is easy to find out where to do that.
* [SAMP:Upgrade ready]. Any layer could profit from components. Internal or third parties. These could become obsolete. The upgrade or component replacement could be done easily. It will impact only one layer, totally separated from others. Any impacts on its consumers are reduced or avoided.










|H4 [NAME:layr] Layered Architecture
|PR [URL:#top     | TEXT: top]

The [SAMP:Application tier], Application Server has internal structure named as the [SAMP:Layered Architecture]. Layers are pieces of code, modules which do have clear and known special responsibilities.




|H5 [NAME:data] Data layer
|PR [URL:#top     | TEXT: top]


The [SAMP:Data layer] is responsible for communication with the [SAMP:Persistence tier]. That is mostly data retrieving/sending from/into [V:Database/SQL Server]. But it could be any operation, which has to get/set data. Responsibilities:
# Assure transaction of operation on write operations [I:(all or nothing)]
# Read data effectively


Database tables and its records, [I:(config)] files, images on file-shares, external Web Services... To get data from [I:(and set data into)] these types of persistence, we do use [SAMP:Data Layer].

|H6 What is the benefit?

Writing into persistence is a fragile operation. Often it is not stand alone, it could be a batch operation [I:(insert new record, store image, change status of an owner)]. These must be wrapped in transactions [I:(see: [URL:Transaction processing|https://en.wikipedia.org/wiki/Transaction_processing])] to grant that all write operations succeed or neither of them.

Reading could be very costly operation. It could join more sources of one [V:DataSource] [I:(more tables)] or even more [V:DataSources] [I:(read the image from a file-share to current record)]. While the optimization could be done on the [V:DataSource] system [I:(e.g. Indexing)], Data Layer can introduce [SAMP:Caching]

So, we need read/write operations. These must be reliable [I:(Transactions)] and fast [I:(caching)]. If there is dedicated layer in the system, the [SAMP:Data Layer], and all other parts do call its public interfaces to get/set data, we can easily fulfill all requirements at once.

|H6 Dao - Data access object

The [URL:Data access object|https://en.wikipedia.org/wiki/Data_access_object] extract:
[BQ
DAO is an object that provides an abstract interface to some type of database or other persistence mechanism. By mapping application calls to the persistence layer, DAOs provide some specific data operations without exposing details of the database. This isolation separates the concerns of what data accesses the application needs, in terms of domain-specific objects and data types [I:(the public interface of the DAO)], and how these needs can be satisfied with a specific DBMS, database schema, etc. [I:(the implementation of the DAO)].
BQ]

So, to get or set the Entity, amend its properties, any part of the application has to use the [B:DAO], represented by its [V:interface]

[CODE
public interface IDao&lt;TEntity&gt;
{
   // Read
   TEntity GetById(int id)
   IEnumerable&lt;TEntity&gt; Find(Filter filter)
 
   // Write
   TEntity Add(TEntity entity)
   TEntity Update(TEntity entity)
   void Delete(TEntity entity)
}
CODE]

Beyond these methods, NHibernate generates the correct SQL statements [I:(SELECT, INSERT...)]. For its consumers [I:(e.g. Business Layer)] it is just a call to get Entity or pass amended object back to persistence.












|H5 [NAME:busi] Business layer
|PR [URL:#top     | TEXT: top]

Any piece of data, any information, should go through [SAMP:Business Layer]. Because this layer, is a place where the "raw data" get the meaning and becomes [V:Entities] of the [V:Domain model]. 

Business Layer responsibilities:
# Security: can Current user get the required information?
# Validation: is the amendment required by Client Application correct?

For example [V:Employee record] has its property [V:Status]. The [SAMP:Business layer] can extended this information [I:(A-Active)] with the meaning, workflow impacts. Employee with a [V:Status] [I:A-Active] can be moved to [V:Status] [I:N-NotActive], but only if there are no pending dependencies. Evaluation of these conditions, giving the meaning to numbers/strings... is responsibility of the [SAMP:Business Layer]

There are calls from Client Application(s) which will require some [V:data write] operations. Before these changes are applied into persistence [I:(only though the [SAMP:Data layer])], the [SAMP:Business Layer] has to do some validation

Are the changes allowed at all? Do new values fit into boundaries of the Business Rules? Does [B:Current user] have rights to apply these changes?

From a Consumer, Client Application perspective, the [B:Application tier] mostly represents the Business Domain model. It is expected that Business rules and security checks are correctly applied. And this fundamental principal expected from the [SAMP:Application tier] is internally managed by the [SAMP:Business Layer].

To achieve that we use some design patterns there. Namely [SAMP:Facades], [SAMP:Validators], [SAMP:Factory Methods] etc.




|H6 Facade pattern

The [URL:Facade pattern |https://en.wikipedia.org/wiki/Facade_pattern] extract:
[BQ
A Facade is an object that provides a simplified interface to a larger body of code, such as a class library
BQ]


Each Entity in the system, part of the Domain Model, has its [SAMP:Facade] object. Its interface (the contract used by other layers) could be expressed like this

[CODE
public interface IFacade&lt;TEntity&gt;
{
   // Read
   TEntity GetById(int id)
   IEnumerable&lt;TEntity&gt; Find(Filter filter)
 
   // Write
   TEntity Add(TEntity entity)
   TEntity Update(TEntity entity)
   void Delete(TEntity entity)
 
   // Factory Method
   TEntity CreateNew()
}
CODE]

The Facade methods are very similar to Dao. In fact, they internally do call Dao. But they also wrap other calls, e.g. to Validators, to assure, that all required rules are fulfilled.

In case, that Business rules are broken, Facade won't call DAO. No change will be persisted. Instead to the Caller is returned a set of Messages. These contain Severity and Description of the error.

The Facade methods GetById or Find are only way how to get Data from the persistence. Therefore security, if Current user does have access to the selected entity(ies) is applied exactly here.

Important is, that for Consumers of the Facade (e.g. Service Layer) is all the complexity hidden behind these few methods. 



|H6 Factory Method

The [V:Domain model] could contain simple, but also complex [V:Entities]. They can have many settings, from which some could be derived from external settings [I:(e.g. Current User country)]

The Factory Method is a pattern, granting consistency in object creation. If there is need to create new Employee instnace, calling code should call the [SAMP:Business Layer] like this:


[CODE
var employee = EmployeeFacade.CreateNew();
CODE]

That will ensure, that only one place in the application is responsible of the object creation. Any later requirements, extending etc. are easily managed and embedded.









|H5 [NAME:serv] Service layer
|PR [URL:#top     | TEXT: top]


The [SAMP:Service Layer] is the communication layer. Its responsibilities are to:
# Handle the request from the Client, convert it into the internal calls [I:(e.g. the [SAMP:Business Layer] Facade)]
# Transform the result into the Client specific format [I:(JSON in case of Web API)]
# Caching

[SAMP:Service Layer] is also the physical End point of communication. All Consumers call the Application Server via its Service Layer. 

The Service of an Entity could be expressed like this (simplified version):

[CODE
public interface IService&lt;TEntity&gt;
{
   // Read
   TEntity GetById(int id)
   IEnumerable&lt;TEntity&gt; Find(Filter filter)
 
   // Write
   HttpResponse Add(TEntity entity)
   HttpResponse Update(TEntity entity)
   HttpResponse Delete(TEntity entity)
}
CODE]

It is again almost the same as [SAMP:IDao] or [SAMP:IFacade]. Internally the calls are really redirected to [I:IFacade]. The [SAMP:Service Layer] is just converting the [V:JSON] format, used as a communication standard. 

Caching is another feature, which could be done on the [SAMP:Service Layer]. If there are requests to almost-not-changing objects [I:(E.g. the list of Countries)], there is inefficiency to call all layers and even the [SAMP:Persistence tier]. Such request, could be cached. The only point which is checked here is the security. Each request, even the cached, must be evaluated with the Current user access rights.


|H5 [NAME:cros] Cross-cutting concepts
|PR [URL:#top     | TEXT: top]

Authentication, Exception Handling, Auditing, Logging...

There are some principles, which are running through all Layers. They are typically the same everywhere, and require common, standardized handling. E.g. Exception could arise anywhere in the application [I:(Database is offline; File System is locked for writing, send JSON message is in a wrong format....)

Cross-cutting concepts are known issues. So they must be handled, and they must be independent on any Layer. They are very often represented by Handlers which are connected to some events (OnException, OnSave...)

Security in common is Cross-cutting concept. Its main part could be driven by needs of business users/application owners. Therefore could be partially part of the [SAMP:Business layer]. For example: only users who are related to some Entity could see it. Or only "Active" entities could be enabled for editing...

Some parts of security could depend on [V:Active Directory] settings. These are often represented as "Roles" and role access.




|H4 [NAME:desg] Design Patterns
|PR [URL:#top     | TEXT: top]

Design patterns [I:(see more [URL:here|https://en.wikipedia.org/wiki/Design_patterns])]:

[BQ
Each pattern describes a problem that occurs over and over again in our environment, and then describes the core of the solution to that problem, in such a way that you can use this solution a million times over, without ever doing it the same way twice
BQ]

[I:This list of common patterns often used in Application Server implementation shows not only the Design Patterns, but also some Architectural ones.]

[LI
Facade
Factory Method
Builder
Chain of Responsibility
State object
Singleton
Wrapper/Adapter
Lazy initialization
Dependency Injection [I:(Inversion of Control)]
AOP
LI]


 

 
 
 
 
 
 
|PR [URL:#top     | TEXT: top]</Text>
    <HtmlText>&lt;h1&gt;
The Web API Architecture &lt;a name="top" &gt;&lt;/a&gt;&lt;/h1&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="#tech" title="#tech" &gt; Technology overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#tier" title="#tier" &gt; Architectural tiers&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#peti" title="#peti" &gt; Persistence tier&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#apti" title="#apti" &gt; Application tier&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#clti" title="#clti" &gt; Client tier&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#arch" title="#arch" &gt; Patterns &amp;amp; practices Application Architecture&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#layr" title="#layr" &gt; Layered Architecture&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#data" title="#data" &gt; Data layer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#busi" title="#busi" &gt; Business layer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#serv" title="#serv" &gt; Service layer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#cros" title="#cros" &gt; Cross-cutting concepts&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#desg" title="#desg" &gt; Design Patterns&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
&lt;a name="tech" &gt;&lt;/a&gt; Technology overview&lt;/h2&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;A list of used technologies&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;MS Windows Server 2008+&lt;/li&gt;
&lt;li&gt;MS SQL Server 2008+&lt;/li&gt;
&lt;li&gt;MS IIS 7+&lt;/li&gt;
&lt;li&gt;VS 2012&lt;/li&gt;
&lt;li&gt;MS .NET 4.5+ (C#)&lt;/li&gt;
&lt;li&gt;NHibernate 3+&lt;/li&gt;
&lt;li&gt;Json.NET&lt;/li&gt;
&lt;li&gt;OpenXML&lt;/li&gt;
&lt;li&gt;MS Web API infrastructure&lt;/li&gt;
&lt;li&gt;ODAta v 2.0&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;b&gt;Persistence tier&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;The key part of the &lt;samp&gt;Persistence tier&lt;/samp&gt; is the &lt;b&gt;Database&lt;/b&gt; - &lt;var&gt;MS SQL Server 2008&lt;/var&gt;+. There are also other types of data storages: &lt;var&gt;File System&lt;/var&gt;s on dedicated servers accessed as the &lt;var&gt;file-shares&lt;/var&gt; &lt;i&gt;(images, files)&lt;/i&gt;. We are also reading some information from &lt;var&gt;Active Directory&lt;/var&gt;. There are some connection to other systems as well, e.g. &lt;var&gt;Web Services&lt;/var&gt;, &lt;var&gt;Data exports&lt;/var&gt; &lt;i&gt;(text files)&lt;/i&gt; etc.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Application tier&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;The &lt;b&gt; Web API&lt;/b&gt; is in fact &lt;b&gt;Application Server&lt;/b&gt; &lt;i&gt;(so called &lt;samp&gt;Application tier&lt;/samp&gt;, see below)&lt;/i&gt;. It is deployed on &lt;var&gt;MS Windows Server 2008+&lt;/var&gt;, and communicates with its &lt;i&gt;Consumers&lt;/i&gt; &lt;i&gt;(so called &lt;samp&gt;Client tier&lt;/samp&gt; via &lt;var&gt;HTTP protocol&lt;/var&gt;, see more &lt;a href="http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol" title="http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol" &gt;here&lt;/a&gt;)&lt;/i&gt;. The Application is a part of the MS IIS &lt;i&gt;(see &lt;a href="http://en.wikipedia.org/wiki/Internet_Information_Services" title="http://en.wikipedia.org/wiki/Internet_Information_Services" &gt;Internet Information Services&lt;/a&gt;)&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;The &lt;b&gt;Application Server&lt;/b&gt; communicates with the Database via &lt;var&gt;MS ADO.NET&lt;/var&gt;. As a runtime we are using &lt;var&gt; MS .NET 4.5+&lt;/var&gt;, the programming language is &lt;var&gt;C#&lt;/var&gt;. Solution is developed in &lt;var&gt;MS Visual Studio 2012+&lt;/var&gt;&lt;/p&gt;
&lt;p&gt;The &lt;b&gt;Application Server&lt;/b&gt; has a &lt;b&gt;Layered Architecture&lt;/b&gt; &lt;i&gt;(see more below)&lt;/i&gt;. Each of the layers has specific concern and uses many external components. &lt;/p&gt;
&lt;p&gt;The &lt;samp&gt;Data Layer&lt;/samp&gt; profits from ORM &lt;i&gt;(see: &lt;a href="http://en.wikipedia.org/wiki/Object-relational_mapping" title="http://en.wikipedia.org/wiki/Object-relational_mapping" &gt;Object-relational mapping&lt;/a&gt;)&lt;/i&gt; engine &lt;a href="http://en.wikipedia.org/wiki/NHibernate" title="http://en.wikipedia.org/wiki/NHibernate" &gt;NHibernate&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;The &lt;samp&gt;Service Layer&lt;/samp&gt; is handling requests and sending results in a &lt;a href="http://en.wikipedia.org/wiki/JSON" title="http://en.wikipedia.org/wiki/JSON" &gt;JSON&lt;/a&gt; format, the engine used is &lt;a href="http://james.newtonking.com/projects/json/help/" title="http://james.newtonking.com/projects/json/help/" &gt; Json.NET&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Other components used are &lt;a href="http://logging.apache.org/log4net/" title="http://logging.apache.org/log4net/" &gt;Log4NET&lt;/a&gt;, MS &lt;a href="http://www.asp.net/web-api" title="http://www.asp.net/web-api" &gt;Web API&lt;/a&gt; infrastructure, IoC Container &lt;a href="http://structuremap.net/" title="http://structuremap.net/" &gt;StructureMap&lt;/a&gt; &lt;i&gt;(see more: &lt;a href="http://en.wikipedia.org/wiki/Inversion_of_control" title="http://en.wikipedia.org/wiki/Inversion_of_control" &gt;Inversion of control&lt;/a&gt;)&lt;/i&gt;, the MS Office documents are processed with &lt;a href="http://en.wikipedia.org/wiki/Office_Open_XML" title="http://en.wikipedia.org/wiki/Office_Open_XML" &gt;MS OpenXML&lt;/a&gt; API.&lt;/p&gt;
&lt;p&gt;The &lt;b&gt;Web API&lt;/b&gt; uses &lt;var&gt;REST architectural style&lt;/var&gt; &lt;i&gt;(see:&lt;a href="https://en.wikipedia.org/wiki/Representational_state_transfer" title="https://en.wikipedia.org/wiki/Representational_state_transfer" &gt;Representational state transfer&lt;/a&gt;)&lt;/i&gt;. To get more and farther details about The Web API implementation, please see &lt;a href="/Articles/Code/WebAPIOverview" title="/Articles/Code/WebAPIOverview" &gt;The concept of the Web API for&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;As a querying standard, we&amp;#39;ve implemented &lt;i&gt;(partially)&lt;/i&gt; the &lt;var&gt;OData protocol&lt;/var&gt; &lt;i&gt;(see more &lt;a href="https://en.wikipedia.org/wiki/OData" title="https://en.wikipedia.org/wiki/OData" &gt;Open Data Protocol&lt;/a&gt;)&lt;/i&gt;. This way, any consumer can filter, sort and limit results returned by the Web API &lt;i&gt;(e.g. ListView, sorted by name, only first 20 rows displayed on the first page)&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="/files/Architecture/TechSummary.jpg" alt="/files/Architecture/TechSummary.jpg" style="width: 800px;height: 496px;" /&gt;&lt;/p&gt;
&lt;h2&gt;
&lt;a name="tier" &gt;&lt;/a&gt; Architectural tiers&lt;/h2&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The most complex view of the overall Architecture used in our Solution could be split into 3 independent tiers:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Database &lt;samp&gt; Persistence tier&lt;/samp&gt;&lt;/li&gt;
&lt;li&gt;Application Server&amp;nbsp;&amp;nbsp;&lt;samp&gt; Application tier&lt;/samp&gt;&lt;/li&gt;
&lt;li&gt;Consumers, Client Applications&amp;nbsp;&amp;nbsp;&lt;samp&gt; Client tier&lt;/samp&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Next diagram distinguishes these tiers as &lt;b&gt;really indendent&lt;/b&gt; blocks. Firstly, they are deployed on different Servers and HW, so they are really split. They do comunicate with each other via known, published &lt;b&gt;API&lt;/b&gt; &lt;i&gt;(see more &lt;a href="https://en.wikipedia.org/wiki/API" title="https://en.wikipedia.org/wiki/API" &gt;here&lt;/a&gt;)&lt;/i&gt;. That is, each tier does its job regardless of the other. From development/maintenance perspective this means that we can concentrate on different requirements in a different time period on any of these tiers.&lt;/p&gt;
&lt;h6&gt;
3-tiers Architecture&lt;/h6&gt;
&lt;p&gt;&lt;img src="/files/Architecture/3Tier.jpg" alt="/files/Architecture/3Tier.jpg" style="width: 800px;height: 598px;" /&gt;&lt;/p&gt;
&lt;h4&gt;
&lt;a name="peti" &gt;&lt;/a&gt; Database &lt;samp&gt; Persistence tier&lt;/samp&gt;&lt;/h4&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The &lt;samp&gt;Persistence tier&lt;/samp&gt; &lt;i&gt;(Database MS SQL Server mostly)&lt;/i&gt; is responsible for 1) data consistency and 2) performance. &lt;/p&gt;
&lt;p&gt;While The &lt;samp&gt;Application tier&lt;/samp&gt; &lt;i&gt;(see below)&lt;/i&gt; is responsible of the consistency from the Business perspective &lt;i&gt;(i.e. it should not allow delete the item which is still in use)&lt;/i&gt;, the Database should double these checks. Any constraints, reference checks, transaction scope changes etc. are one of the key parts of the &lt;samp&gt;Persistence tier&lt;/samp&gt;.&lt;/p&gt;
&lt;p&gt;Performance optimization is the second fundament of the &lt;samp&gt;Persistence tier&lt;/samp&gt;. Regardless of the &amp;quot;not efficient&amp;quot; queries &lt;i&gt;(coming from Application or Client tiers)&lt;/i&gt;, the real power of SQL Engine is used and granted here &lt;i&gt;(Clustered and Non-clustered Indexes, full-text catalogues, optimized data types...)&lt;/i&gt;&lt;/p&gt;
&lt;h4&gt;
&lt;a name="apti" &gt;&lt;/a&gt; Application Server &lt;samp&gt; Application tier&lt;/samp&gt;&lt;/h4&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The &lt;samp&gt;Application tier&lt;/samp&gt; represents a concept of separation of concern. There are no limitations of the UI here. There is loose dependency of the underlying persistence structure. The only concern is the application of &lt;b&gt;Business rules&lt;/b&gt; &lt;i&gt;(the security is part of them)&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;At the end, &lt;samp&gt;Application tier&lt;/samp&gt; publishes CRUD operations &lt;i&gt;(see &lt;a href="https://en.wikipedia.org/wiki/CRUD" title="https://en.wikipedia.org/wiki/CRUD" &gt;Create, read, update and delete&lt;/a&gt;)&lt;/i&gt; to the Consumers, Client Applications. These API operations/methods are granted to follow all business requirements, will apply all rules, and check the Application consistency &lt;i&gt;(e.g. handle the concurrency issues)&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;It also extends support of a &lt;samp&gt;Client tier&lt;/samp&gt; with the &lt;samp&gt;MetaData&lt;/samp&gt; concept. It could be seen as a service, as a communication way to the Client Application describing: what could be done, what are available next steps. It takes into account not only current entity &lt;i&gt;(e.g. Employee record)&lt;/i&gt; but the &lt;b&gt;current user&lt;/b&gt; security context as well.&lt;/p&gt;
&lt;p&gt;Other words, Client Applications are not only provided with resume of their actions &lt;i&gt;(e.g. create, update)&lt;/i&gt; ex post. But they do have enough information even before the action is called at all &lt;i&gt;(is it allowed to delete current record?)&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;The &lt;samp&gt;Application tier&lt;/samp&gt; is central point of ourWeb API.&lt;/p&gt;
&lt;h4&gt;
&lt;a name="clti" &gt;&lt;/a&gt; Consumers, Client Applications &lt;samp&gt; Client tier&lt;/samp&gt;&lt;/h4&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The User Interface &lt;i&gt;(UI)&lt;/i&gt;, PC, modern devices, &amp;quot;User experience&amp;quot;... these are building blocks of the &lt;samp&gt;Client tier&lt;/samp&gt;. There could be many HW devices &lt;i&gt;(PC, Tablet, Mobile phone)&lt;/i&gt;, many technologies &lt;i&gt;(Rich WPF application, light web-mobile summary)&lt;/i&gt;. These can provide nice independent views on top of calls to Web API. They do not have to care about the Business rules. It is already done on &lt;samp&gt;Application tier&lt;/samp&gt;. Client Applications just can do some pre-checks (&lt;samp&gt;MetaData&lt;/samp&gt; concept), but the main concern is user experience.&lt;/p&gt;
&lt;p&gt;The benefit of the 3-tier Architecture was already proven on many projects, in many companies. While all Business rules, security, logging... is granted to be done on one place (&lt;samp&gt;Application tier&lt;/samp&gt;), there could be one or many Client Applications consuming the same API, but each with different goal. &lt;/p&gt;
&lt;p&gt;These, Client Applications, do have its own concern: Provide the ultimate user experience. Easy navigation, simple editing, smart ListViews, with paging. Providing the merge of other API services &lt;i&gt;(Get an Employee record from Web API, while ask for its Photo another service)&lt;/i&gt;.&lt;/p&gt;
&lt;p&gt;Clearly, Client Applications do not have to handle all the complexity of the Business rules. They simply call Get or Find.. and if needed they Amend or Insert new values. With a MetaData concepts, Consumers can extend the UI with available actions&amp;nbsp;&amp;nbsp;&lt;i&gt;(e.g. for a workflow - User will immediately know what are next states of currently selected Entity)&lt;/i&gt;.&lt;/p&gt;
&lt;h5&gt;
Summary&lt;/h5&gt;
&lt;p&gt;The concept of 3-tier Architecture should bring much more better User experience. There could be many, very different &lt;b&gt;Client Applications&lt;/b&gt; &lt;i&gt;(Mobile for a quick overview vs Rich &amp;quot;fat&amp;quot; clients for a bulk editing...)&lt;/i&gt;. There is only one Ruler, one place granting all Consumers that the actions will be correctly handled. This is the &lt;b&gt;Application Server&lt;/b&gt;. And &lt;samp&gt;Persistence tier&lt;/samp&gt; concentrates on data consistency and fast querying.&lt;/p&gt;
&lt;h2&gt;
&lt;a name="arch" &gt;&lt;/a&gt; Patterns &amp;amp; practices Application Architecture&lt;/h2&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In previous section we&amp;#39;ve seen that Web API is a middle tier, the &lt;samp&gt;Application tier&lt;/samp&gt;, in the 3-tier Architecture. Next sections will take us into more detailed discussion about Application Server and its &lt;samp&gt;Layered Architecture&lt;/samp&gt;&lt;/p&gt;
&lt;p&gt;The Web API, Application Server is built on top of the &lt;span style="color:Green;" &gt;patterns &amp;amp; practices Application Architecture&lt;/span&gt; published by Microsoft (see more &lt;a href="https://apparchguide.codeplex.com/" title="https://apparchguide.codeplex.com/" &gt;here&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;Short extract:&lt;/p&gt;
&lt;blockquote class="bq" &gt;
This guide provides design-level guidance for the architecture and design of applications built on the .NET Framework. It focuses on the most common types of applications, partitioning application functionality into layers, components, and services, and walks through their key design characteristics. This guide is a collaborative effort between patterns &amp;amp; practices, product teams, and industry experts.&lt;br /&gt;
&lt;/blockquote&gt;
&lt;p&gt;Let&amp;#39;s start with an overview. The MS Guidance provides this drawing: &lt;/p&gt;
&lt;p&gt;&lt;i&gt;(Drawing taken from &lt;a href="https://apparchguide.codeplex.com/" title="https://apparchguide.codeplex.com/" &gt; Microsoft Application Architecture Guide&lt;/a&gt; 2&lt;sup&gt;nd&lt;/sup&gt; Edition)&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="/files/Architecture/Architecture.png" alt="/files/Architecture/Architecture.png" style="" /&gt;&lt;/p&gt;
&lt;h3&gt;
Separation of concern&lt;/h3&gt;
&lt;p&gt;The first look on a visualize Layered Architecture shows, that the key to success is a separation of concern. There are building blocks, large one, called layers. These are in fact built of other (smaller) blocks (see &lt;a href="https://en.wikipedia.org/wiki/Design_patterns" title="https://en.wikipedia.org/wiki/Design_patterns" &gt;design patterns&lt;/a&gt;). &lt;/p&gt;
&lt;p&gt;This approach &lt;i&gt;(if successfully implemented and followed)&lt;/i&gt; brings many advantages. Let&amp;#39;s mention at least few of them&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;samp&gt;Loose Dependency&lt;/samp&gt;. Each layer is independent. There is no direct connectivity. The communication is done (as indicates Cross Cutting block) over commonly published &lt;var&gt;interfaces&lt;/var&gt;. (see more here: &lt;a href="http://en.wikipedia.org/wiki/Loose_coupling" title="http://en.wikipedia.org/wiki/Loose_coupling" &gt;Loose coupling&lt;/a&gt;) &lt;/li&gt;
&lt;li&gt;&lt;samp&gt;Responsibility&lt;/samp&gt;. Each layer has its own responsibility(-ies) (e.g. rules validation, SQL statement execution etc.) which cannot be done elswhere. If there is any requirement on the Application, it is clear and obvious how and where will be handled (i.e. Business rules are evaluated on a Business Layer, while the SQL Scripts are under the domain of the Data layer)&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;Extensibility&lt;/samp&gt;. Each layer can be extended. It can provide more functionality, while it never will break the current one. That&amp;#39;s thanks to &lt;a href="http://en.wikipedia.org/wiki/Open/closed_principle" title="http://en.wikipedia.org/wiki/Open/closed_principle" &gt; Open/Close principle&lt;/a&gt;. &lt;/li&gt;
&lt;li&gt;&lt;samp&gt;Maintenance&lt;/samp&gt;. In cases that The Application needs to be amended (to fix a bug, implement change) it is easy to find out where to do that.&lt;/li&gt;
&lt;li&gt;&lt;samp&gt;Upgrade ready&lt;/samp&gt;. Any layer could profit from components. Internal or third parties. These could become obsolete. The upgrade or component replacement could be done easily. It will impact only one layer, totally separated from others. Any impacts on its consumers are reduced or avoided.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;
&lt;a name="layr" &gt;&lt;/a&gt; Layered Architecture&lt;/h4&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The &lt;samp&gt;Application tier&lt;/samp&gt;, Application Server has internal structure named as the &lt;samp&gt;Layered Architecture&lt;/samp&gt;. Layers are pieces of code, modules which do have clear and known special responsibilities.&lt;/p&gt;
&lt;h5&gt;
&lt;a name="data" &gt;&lt;/a&gt; Data layer&lt;/h5&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The &lt;samp&gt;Data layer&lt;/samp&gt; is responsible for communication with the &lt;samp&gt;Persistence tier&lt;/samp&gt;. That is mostly data retrieving/sending from/into &lt;var&gt;Database/SQL Server&lt;/var&gt;. But it could be any operation, which has to get/set data. Responsibilities:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Assure transaction of operation on write operations &lt;i&gt;(all or nothing)&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;Read data effectively&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Database tables and its records, &lt;i&gt;(config)&lt;/i&gt; files, images on file-shares, external Web Services... To get data from &lt;i&gt;(and set data into)&lt;/i&gt; these types of persistence, we do use &lt;samp&gt;Data Layer&lt;/samp&gt;.&lt;/p&gt;
&lt;h6&gt;
What is the benefit?&lt;/h6&gt;
&lt;p&gt;Writing into persistence is a fragile operation. Often it is not stand alone, it could be a batch operation &lt;i&gt;(insert new record, store image, change status of an owner)&lt;/i&gt;. These must be wrapped in transactions &lt;i&gt;(see: &lt;a href="https://en.wikipedia.org/wiki/Transaction_processing" title="https://en.wikipedia.org/wiki/Transaction_processing" &gt;Transaction processing&lt;/a&gt;)&lt;/i&gt; to grant that all write operations succeed or neither of them.&lt;/p&gt;
&lt;p&gt;Reading could be very costly operation. It could join more sources of one &lt;var&gt;DataSource&lt;/var&gt; &lt;i&gt;(more tables)&lt;/i&gt; or even more &lt;var&gt;DataSources&lt;/var&gt; &lt;i&gt;(read the image from a file-share to current record)&lt;/i&gt;. While the optimization could be done on the &lt;var&gt;DataSource&lt;/var&gt; system &lt;i&gt;(e.g. Indexing)&lt;/i&gt;, Data Layer can introduce &lt;samp&gt;Caching&lt;/samp&gt;&lt;/p&gt;
&lt;p&gt;So, we need read/write operations. These must be reliable &lt;i&gt;(Transactions)&lt;/i&gt; and fast &lt;i&gt;(caching)&lt;/i&gt;. If there is dedicated layer in the system, the &lt;samp&gt;Data Layer&lt;/samp&gt;, and all other parts do call its public interfaces to get/set data, we can easily fulfill all requirements at once.&lt;/p&gt;
&lt;h6&gt;
Dao - Data access object&lt;/h6&gt;
&lt;p&gt;The &lt;a href="https://en.wikipedia.org/wiki/Data_access_object" title="https://en.wikipedia.org/wiki/Data_access_object" &gt;Data access object&lt;/a&gt; extract:&lt;/p&gt;
&lt;blockquote class="bq" &gt;
DAO is an object that provides an abstract interface to some type of database or other persistence mechanism. By mapping application calls to the persistence layer, DAOs provide some specific data operations without exposing details of the database. This isolation separates the concerns of what data accesses the application needs, in terms of domain-specific objects and data types &lt;i&gt;(the public interface of the DAO)&lt;/i&gt;, and how these needs can be satisfied with a specific DBMS, database schema, etc. &lt;i&gt;(the implementation of the DAO)&lt;/i&gt;.&lt;br /&gt;
&lt;/blockquote&gt;
&lt;p&gt;So, to get or set the Entity, amend its properties, any part of the application has to use the &lt;b&gt;DAO&lt;/b&gt;, represented by its &lt;var&gt;interface&lt;/var&gt;&lt;/p&gt;
&lt;code class="code" &gt;
&lt;span class="base" &gt;public&lt;/span&gt; &lt;span class="base" &gt;interface&lt;/span&gt; IDao&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;TEntity&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;span class="cmmnt" &gt;// Read
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp; TEntity GetById&lt;span class="smbl" &gt;(&lt;/span&gt;&lt;span class="type" &gt;int&lt;/span&gt; id&lt;span class="smbl" &gt;)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; IEnumerable&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;TEntity&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt; Find&lt;span class="smbl" &gt;(&lt;/span&gt;Filter filter&lt;span class="smbl" &gt;)&lt;/span&gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;span class="cmmnt" &gt;// Write
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp; TEntity Add&lt;span class="smbl" &gt;(&lt;/span&gt;TEntity entity&lt;span class="smbl" &gt;)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; TEntity Update&lt;span class="smbl" &gt;(&lt;/span&gt;TEntity entity&lt;span class="smbl" &gt;)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;span class="base" &gt;void&lt;/span&gt; Delete&lt;span class="smbl" &gt;(&lt;/span&gt;TEntity entity&lt;span class="smbl" &gt;)&lt;/span&gt;&lt;br /&gt;
&lt;span class="smbl" &gt;}&lt;/span&gt;&lt;br /&gt;
&lt;/code&gt;
&lt;p&gt;Beyond these methods, NHibernate generates the correct SQL statements &lt;i&gt;(SELECT, INSERT...)&lt;/i&gt;. For its consumers &lt;i&gt;(e.g. Business Layer)&lt;/i&gt; it is just a call to get Entity or pass amended object back to persistence.&lt;/p&gt;
&lt;h5&gt;
&lt;a name="busi" &gt;&lt;/a&gt; Business layer&lt;/h5&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Any piece of data, any information, should go through &lt;samp&gt;Business Layer&lt;/samp&gt;. Because this layer, is a place where the &amp;quot;raw data&amp;quot; get the meaning and becomes &lt;var&gt;Entities&lt;/var&gt; of the &lt;var&gt;Domain model&lt;/var&gt;. &lt;/p&gt;
&lt;p&gt;Business Layer responsibilities:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Security: can Current user get the required information?&lt;/li&gt;
&lt;li&gt;Validation: is the amendment required by Client Application correct?&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For example &lt;var&gt;Employee record&lt;/var&gt; has its property &lt;var&gt;Status&lt;/var&gt;. The &lt;samp&gt;Business layer&lt;/samp&gt; can extended this information &lt;i&gt;(A-Active)&lt;/i&gt; with the meaning, workflow impacts. Employee with a &lt;var&gt;Status&lt;/var&gt; &lt;i&gt;A-Active&lt;/i&gt; can be moved to &lt;var&gt;Status&lt;/var&gt; &lt;i&gt;N-NotActive&lt;/i&gt;, but only if there are no pending dependencies. Evaluation of these conditions, giving the meaning to numbers/strings... is responsibility of the &lt;samp&gt;Business Layer&lt;/samp&gt;&lt;/p&gt;
&lt;p&gt;There are calls from Client Application(s) which will require some &lt;var&gt;data write&lt;/var&gt; operations. Before these changes are applied into persistence &lt;i&gt;(only though the &lt;samp&gt;Data layer&lt;/samp&gt;)&lt;/i&gt;, the &lt;samp&gt;Business Layer&lt;/samp&gt; has to do some validation&lt;/p&gt;
&lt;p&gt;Are the changes allowed at all? Do new values fit into boundaries of the Business Rules? Does &lt;b&gt;Current user&lt;/b&gt; have rights to apply these changes?&lt;/p&gt;
&lt;p&gt;From a Consumer, Client Application perspective, the &lt;b&gt;Application tier&lt;/b&gt; mostly represents the Business Domain model. It is expected that Business rules and security checks are correctly applied. And this fundamental principal expected from the &lt;samp&gt;Application tier&lt;/samp&gt; is internally managed by the &lt;samp&gt;Business Layer&lt;/samp&gt;.&lt;/p&gt;
&lt;p&gt;To achieve that we use some design patterns there. Namely &lt;samp&gt;Facades&lt;/samp&gt;, &lt;samp&gt;Validators&lt;/samp&gt;, &lt;samp&gt;Factory Methods&lt;/samp&gt; etc.&lt;/p&gt;
&lt;h6&gt;
Facade pattern&lt;/h6&gt;
&lt;p&gt;The &lt;a href="https://en.wikipedia.org/wiki/Facade_pattern" title="https://en.wikipedia.org/wiki/Facade_pattern" &gt;Facade pattern &lt;/a&gt; extract:&lt;/p&gt;
&lt;blockquote class="bq" &gt;
A Facade is an object that provides a simplified interface to a larger body of code, such as a class library&lt;br /&gt;
&lt;/blockquote&gt;
&lt;p&gt;Each Entity in the system, part of the Domain Model, has its &lt;samp&gt;Facade&lt;/samp&gt; object. Its interface (the contract used by other layers) could be expressed like this&lt;/p&gt;
&lt;code class="code" &gt;
&lt;span class="base" &gt;public&lt;/span&gt; &lt;span class="base" &gt;interface&lt;/span&gt; IFacade&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;TEntity&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;span class="cmmnt" &gt;// Read
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp; TEntity GetById&lt;span class="smbl" &gt;(&lt;/span&gt;&lt;span class="type" &gt;int&lt;/span&gt; id&lt;span class="smbl" &gt;)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; IEnumerable&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;TEntity&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt; Find&lt;span class="smbl" &gt;(&lt;/span&gt;Filter filter&lt;span class="smbl" &gt;)&lt;/span&gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;span class="cmmnt" &gt;// Write
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp; TEntity Add&lt;span class="smbl" &gt;(&lt;/span&gt;TEntity entity&lt;span class="smbl" &gt;)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; TEntity Update&lt;span class="smbl" &gt;(&lt;/span&gt;TEntity entity&lt;span class="smbl" &gt;)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;span class="base" &gt;void&lt;/span&gt; Delete&lt;span class="smbl" &gt;(&lt;/span&gt;TEntity entity&lt;span class="smbl" &gt;)&lt;/span&gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;span class="cmmnt" &gt;// Factory Method
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp; TEntity CreateNew&lt;span class="smbl" &gt;(&lt;/span&gt;&lt;span class="smbl" &gt;)&lt;/span&gt;&lt;br /&gt;
&lt;span class="smbl" &gt;}&lt;/span&gt;&lt;br /&gt;
&lt;/code&gt;
&lt;p&gt;The Facade methods are very similar to Dao. In fact, they internally do call Dao. But they also wrap other calls, e.g. to Validators, to assure, that all required rules are fulfilled.&lt;/p&gt;
&lt;p&gt;In case, that Business rules are broken, Facade won&amp;#39;t call DAO. No change will be persisted. Instead to the Caller is returned a set of Messages. These contain Severity and Description of the error.&lt;/p&gt;
&lt;p&gt;The Facade methods GetById or Find are only way how to get Data from the persistence. Therefore security, if Current user does have access to the selected entity(ies) is applied exactly here.&lt;/p&gt;
&lt;p&gt;Important is, that for Consumers of the Facade (e.g. Service Layer) is all the complexity hidden behind these few methods. &lt;/p&gt;
&lt;h6&gt;
Factory Method&lt;/h6&gt;
&lt;p&gt;The &lt;var&gt;Domain model&lt;/var&gt; could contain simple, but also complex &lt;var&gt;Entities&lt;/var&gt;. They can have many settings, from which some could be derived from external settings &lt;i&gt;(e.g. Current User country)&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;The Factory Method is a pattern, granting consistency in object creation. If there is need to create new Employee instnace, calling code should call the &lt;samp&gt;Business Layer&lt;/samp&gt; like this:&lt;/p&gt;
&lt;code class="code" &gt;
&lt;span class="type" &gt;var&lt;/span&gt; employee &lt;span class="smbl" &gt;=&lt;/span&gt; EmployeeFacade.CreateNew&lt;span class="smbl" &gt;(&lt;/span&gt;&lt;span class="smbl" &gt;)&lt;/span&gt;;&lt;br /&gt;
&lt;/code&gt;
&lt;p&gt;That will ensure, that only one place in the application is responsible of the object creation. Any later requirements, extending etc. are easily managed and embedded.&lt;/p&gt;
&lt;h5&gt;
&lt;a name="serv" &gt;&lt;/a&gt; Service layer&lt;/h5&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The &lt;samp&gt;Service Layer&lt;/samp&gt; is the communication layer. Its responsibilities are to:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Handle the request from the Client, convert it into the internal calls &lt;i&gt;(e.g. the &lt;samp&gt;Business Layer&lt;/samp&gt; Facade)&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;Transform the result into the Client specific format &lt;i&gt;(JSON in case of Web API)&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;Caching&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;samp&gt;Service Layer&lt;/samp&gt; is also the physical End point of communication. All Consumers call the Application Server via its Service Layer. &lt;/p&gt;
&lt;p&gt;The Service of an Entity could be expressed like this (simplified version):&lt;/p&gt;
&lt;code class="code" &gt;
&lt;span class="base" &gt;public&lt;/span&gt; &lt;span class="base" &gt;interface&lt;/span&gt; IService&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;TEntity&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="smbl" &gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;span class="cmmnt" &gt;// Read
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp; TEntity GetById&lt;span class="smbl" &gt;(&lt;/span&gt;&lt;span class="type" &gt;int&lt;/span&gt; id&lt;span class="smbl" &gt;)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; IEnumerable&lt;span class="tag" &gt;&lt;span class="smbl" &gt;&amp;lt;&lt;/span&gt;TEntity&lt;span class="smbl" &gt;&amp;gt;&lt;/span&gt;&lt;/span&gt; Find&lt;span class="smbl" &gt;(&lt;/span&gt;Filter filter&lt;span class="smbl" &gt;)&lt;/span&gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;span class="cmmnt" &gt;// Write
&lt;/span&gt;&lt;br /&gt;&lt;span class="cmmnt" &gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp; HttpResponse Add&lt;span class="smbl" &gt;(&lt;/span&gt;TEntity entity&lt;span class="smbl" &gt;)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; HttpResponse Update&lt;span class="smbl" &gt;(&lt;/span&gt;TEntity entity&lt;span class="smbl" &gt;)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; HttpResponse Delete&lt;span class="smbl" &gt;(&lt;/span&gt;TEntity entity&lt;span class="smbl" &gt;)&lt;/span&gt;&lt;br /&gt;
&lt;span class="smbl" &gt;}&lt;/span&gt;&lt;br /&gt;
&lt;/code&gt;
&lt;p&gt;It is again almost the same as &lt;samp&gt;IDao&lt;/samp&gt; or &lt;samp&gt;IFacade&lt;/samp&gt;. Internally the calls are really redirected to &lt;i&gt;IFacade&lt;/i&gt;. The &lt;samp&gt;Service Layer&lt;/samp&gt; is just converting the &lt;var&gt;JSON&lt;/var&gt; format, used as a communication standard. &lt;/p&gt;
&lt;p&gt;Caching is another feature, which could be done on the &lt;samp&gt;Service Layer&lt;/samp&gt;. If there are requests to almost-not-changing objects &lt;i&gt;(E.g. the list of Countries)&lt;/i&gt;, there is inefficiency to call all layers and even the &lt;samp&gt;Persistence tier&lt;/samp&gt;. Such request, could be cached. The only point which is checked here is the security. Each request, even the cached, must be evaluated with the Current user access rights.&lt;/p&gt;
&lt;h5&gt;
&lt;a name="cros" &gt;&lt;/a&gt; Cross-cutting concepts&lt;/h5&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Authentication, Exception Handling, Auditing, Logging...&lt;/p&gt;
&lt;p&gt;There are some principles, which are running through all Layers. They are typically the same everywhere, and require common, standardized handling. E.g. Exception could arise anywhere in the application &lt;i&gt;(Database is offline; File System is locked for writing, send JSON message is in a wrong format....)&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;Cross-cutting concepts are known issues. So they must be handled, and they must be independent on any Layer. They are very often represented by Handlers which are connected to some events (OnException, OnSave...)&lt;/p&gt;
&lt;p&gt;Security in common is Cross-cutting concept. Its main part could be driven by needs of business users/application owners. Therefore could be partially part of the &lt;samp&gt;Business layer&lt;/samp&gt;. For example: only users who are related to some Entity could see it. Or only &amp;quot;Active&amp;quot; entities could be enabled for editing...&lt;/p&gt;
&lt;p&gt;Some parts of security could depend on &lt;var&gt;Active Directory&lt;/var&gt; settings. These are often represented as &amp;quot;Roles&amp;quot; and role access.&lt;/p&gt;
&lt;h4&gt;
&lt;a name="desg" &gt;&lt;/a&gt; Design Patterns&lt;/h4&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Design patterns &lt;i&gt;(see more &lt;a href="https://en.wikipedia.org/wiki/Design_patterns" title="https://en.wikipedia.org/wiki/Design_patterns" &gt;here&lt;/a&gt;)&lt;/i&gt;:&lt;/p&gt;
&lt;blockquote class="bq" &gt;
Each pattern describes a problem that occurs over and over again in our environment, and then describes the core of the solution to that problem, in such a way that you can use this solution a million times over, without ever doing it the same way twice&lt;br /&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;i&gt;This list of common patterns often used in Application Server implementation shows not only the Design Patterns, but also some Architectural ones.&lt;/i&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Facade&lt;/li&gt;
&lt;li&gt;Factory Method&lt;/li&gt;
&lt;li&gt;Builder&lt;/li&gt;
&lt;li&gt;Chain of Responsibility&lt;/li&gt;
&lt;li&gt;State object&lt;/li&gt;
&lt;li&gt;Singleton&lt;/li&gt;
&lt;li&gt;Wrapper/Adapter&lt;/li&gt;
&lt;li&gt;Lazy initialization&lt;/li&gt;
&lt;li&gt;Dependency Injection &lt;i&gt;(Inversion of Control)&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;AOP&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p class="pr" &gt;
&lt;a href="#top" title="#top" &gt; top&lt;/a&gt;&lt;/p&gt;
</HtmlText>
  </Article>
</data>